All Projects → Yalantis → Reactnativetemplate

Yalantis / Reactnativetemplate

Our example of simple application using ReactNative and some recommendations

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Reactnativetemplate

Neos Ui
Neos CMS UI written in ReactJS with Immutable data structures.
Stars: ✭ 238 (+87.4%)
Mutual labels:  immutablejs, redux-saga
next-react-boilerplate
🔥 NextJS with additional tech feature like react-boilerplate. Demo >>
Stars: ✭ 20 (-84.25%)
Mutual labels:  redux-saga, immutablejs
React Next Boilerplate
🚀 A basis for reducing the configuration of your projects with nextJS, best development practices and popular libraries in the developer community.
Stars: ✭ 129 (+1.57%)
Mutual labels:  template, redux-saga
molecule
⚛️ –  – ⚛️ Boilerplate for cross platform web/native react apps with electron.
Stars: ✭ 95 (-25.2%)
Mutual labels:  redux-saga, immutablejs
Starter Lapis
Cutting edge starter kit
Stars: ✭ 72 (-43.31%)
Mutual labels:  immutablejs, redux-saga
Molecule
⚛️ – :atom: – ⚛️ Boilerplate for cross platform web/native react apps with electron.
Stars: ✭ 95 (-25.2%)
Mutual labels:  immutablejs, redux-saga
abilitysheet
This app is ability sheet for beatmania iidx music of level 12.
Stars: ✭ 38 (-70.08%)
Mutual labels:  redux-saga, immutablejs
React Social Network
Simple React Social Network
Stars: ✭ 409 (+222.05%)
Mutual labels:  immutablejs, redux-saga
React Native Template Rocketseat Advanced
Template avançada para aplicações React Native com a estrutura utilizada na Rocketseat 🚀
Stars: ✭ 459 (+261.42%)
Mutual labels:  template, redux-saga
React Eyepetizer
react版「Eyepetizer」开眼短视频
Stars: ✭ 83 (-34.65%)
Mutual labels:  immutablejs, redux-saga
Razzle Material Ui Styled Example
Razzle Material-UI example with Styled Components using Express with compression
Stars: ✭ 117 (-7.87%)
Mutual labels:  example-project, template
Thorui Uniapp
ThorUI组件库,轻量、简洁的移动端组件库。组件文档地址:https://thorui.cn/doc/ 。 最近更新时间:2021-10-01
Stars: ✭ 1,842 (+1350.39%)
Mutual labels:  template
Zparkio
Boiler plate framework to use Spark and ZIO together.
Stars: ✭ 121 (-4.72%)
Mutual labels:  template
Github Downloads Count
A script to get downloads count of your GitHub repositories
Stars: ✭ 120 (-5.51%)
Mutual labels:  github-api
Angular Rpg
RPG game built with Typescript, Angular, ngrx/store and rxjs
Stars: ✭ 120 (-5.51%)
Mutual labels:  immutablejs
Immutable Object Formatter Extension
Make ImmutableJS objects more readable when viewed in Chrome DevTools
Stars: ✭ 125 (-1.57%)
Mutual labels:  immutablejs
Nest
Nest Pelican Template
Stars: ✭ 123 (-3.15%)
Mutual labels:  template
Template Compiler
Compile text/template / html/template to regular go code
Stars: ✭ 120 (-5.51%)
Mutual labels:  template
Template
A super-simple way to create new projects based on templates.
Stars: ✭ 120 (-5.51%)
Mutual labels:  template
Angular5 Example Shopping App
Angular 5 Example Shopping App + Angular Material + Responsive
Stars: ✭ 120 (-5.51%)
Mutual labels:  example-project

React Native Template Project

During our time developing mobile apps we have gathered some experience and preferences in architecture and libraries. We decided to gather it all in one project to share it with all community. So we created this template. We found out and combined the patterns and libraries to make a robust app that works properly on both platforms: Android and iOS.

Read article here

The template project interacts with Github API and covers major user flows:

  1. Login flow. Simple example of fields validation, storing token and so on.
  2. Several tabs with list of items. One in two apps definitely has list of some items or several tabs with lists.
  3. Item details Screen. Example of simple screen with some data.
  4. Logout. To clear state, navigate to certain screen, etc.

Get Started

If you have not yet installed React Native, you can use this tutorial.

Use git clone to get project. Then go to the root folder of project and install all node modules using npm install command.

Run on Android

  1. You have to connect hardware device using ADB or run emulator.
  2. Invoke react-native run-android command.

Run on iOS

  1. You have to get Xcode installed on your machine.
  2. Invoke react-native run-ios command.

Frameworks we suggest using if you need this in your app

  1. Navigator: https://reactnavigation.org/

  2. Strings localization: https://github.com/stefalda/ReactNativeLocalization

  3. Networking: rx-fetch + rxjs

  4. Maps: https://github.com/airbnb/react-native-maps

  5. Permissions: https://github.com/yonahforst/react-native-permissions

  6. Image picker: https://github.com/ivpusic/react-native-image-crop-picker

  7. OpenGL: https://github.com/ProjectSeptemberInc/gl-react-native

  8. Fabric: https://www.npmjs.com/package/react-native-fabric

  9. Icons: https://oblador.github.io/react-native-vector-icons/

  10. UI components: https://nativebase.io/

  11. Dialogs: https://www.npmjs.com/package/react-native-popup-dialog

Our guidelines and some recommendations

  1. Architecture: Redux + saga https://github.com/redux-saga/redux-saga

  2. Code style: https://github.com/airbnb/javascript

  3. Versioning: packadge.json - we freeze versions of the libraries during project development, unless we really need the feature or bugfix from newer version

  4. Use formatting tabulation of 2. Needs to be changed in WebStorm settings

  5. Add all component props to propTypes. It adds safety, shows you what props available, and allows IDEA/WebStorm to autocomplete them. https://facebook.github.io/react/docs/typechecking-with-proptypes.html

  6. Use redux-immutable to create immutable store. Redux FAQ: Immutable Data

    import { combineReducers } from 'redux-immutable';
    import loginReducer from "../reducers/loginReducer";
    import rootReducer from "../reducers/rootReducer";
    import listReducer from "../reducers/listReduser";
    
    const combinedReducers = combineReducers({
        root: rootReducer,
        login: loginReducer,
        list: listReducer,
    });
    

    redux-persist can't work with immutable state. So, we have to use redux-persist-immutable.

    import { autoRehydrate, persistStore } from 'redux-persist-immutable'
    import { applyMiddleware, compose, createStore } from "redux";
    const sagaMiddleware = createSagaMiddleware();
    const store = createStore(
        combinedReducers,
        initialState,
        compose(applyMiddleware(sagaMiddleware), autoRehydrate({log: true})));
    persistStore(
        store,
        {
            storage: AsyncStorage,
            blacklist: ['root'],
        }
    );
    
  7. Antipatterns:

    • Do not use setState() in componentWillMount()
    • Do not perform any logic in render() function
    • Do not use indexes of an array as its keys
    • Do not validate forms with redux store
    • Do not perform any logic in reducers
    • Do not perform too much dispatches
    • Do not rely on JS single thread
    • Do not use x-index a lot
    • Do not use ListView, use FlatList instead
    • Remove console.log() calls
    • Do not use object literals in render()
    • Reduce render() function calls
    • Use InteractionManager.runAfterInteractions() to perform any hard stuff
    • Use requestAnimationFrame to perform animations
    • Extend React.PureComponent as much as possible
    • Use shouldRasterizeIOS
    • Use renderToHardwareTextureAndroid
    • Do not perform any logic in componentWillMount()
    • Use useNativeDriver
    • Don't use toJS() with immutable to avoid creation unnecessary object.
  8. Project structure:

    • android
    • ios
    • node_modules
    • index.android.js
    • index.ios.js
    • app
    • actions
    • login-actions.js
    • sign-up-actions.js
    • components
    • Login.js
    • SignUp.js
    • reducers
    • loginReducer.js
    • signUpReducer.js
    • resources
    • strings.js
    • colors.js
    • dimens.js
    • styles.js
    • store
    • configureStore.js
    • api.js
    • app.js
    • const.js

    The screenshots of our template project

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].