Simple yet practical starter with React Native Navigation v4, MobX-State-Tree and Redux (pick one) and more goodies inside.
It is a basic Reddit App implementation (list of subreddits and news only) where the main goal to achieve was usage of functional components with React Native Navigation. So no more , only functions with React Hooks and native navigation.
The app logic is written in two ways: using MobX-State-Tree in class MyComponent extends React.Component { ... }
/srcMobX
folder and using Redux in /srcRedux
folder. You can find instructions for launching the app using one or another way in index.js
file.
So now you are free to choose any option you love and stick with it!
- React Native Navigation v4 - truly native navigation experience for iOS and Android
- React Native Navigation Hooks - a set of React hooks for React Native Navigation
- React Native Vector Icons - customizable icons for React Native
- React Native Gesture Handler - native touches and gesture system for React Native
- Lodash - just in case, we will need it one time anyways
- Typescript - strict syntactical superset of JavaScript
MOBX | REDUX |
---|---|
MobX - simple, scalable state management | Redux - a predictable state container |
MobX React - official React bindings for MobX | React Redux - official React bindings for Redux |
MobX State Tree (MST) - opinionated, transactional, MobX powered state container | Redux Saga - side effect model for Redux apps |
Persistence and Hydration are done by our hands | Redux Persist - persist and rehydrate a Redux store |
- Clone the repo
git clone https://github.com/kanzitelli/react-native-navigation-starter.git new-project
- Install packages
cd new-project
npm i
cd ios/ && pod install && cd ../
-
Rename the app using react-native-rename if needed. If you do so, don't forget to run
cd ios/ && pod install && cd ../
when the process is finished. Also keep in mind that bundle identifier must be valid for both platforms or change it manually. -
Run it!
react-native run-ios # or react-native run-android
There are still some things I would like to add to the starter:
- Continous delivery via Codepush.
- Styles using Styled Components.
- Maybe something else. Feel free to open an issue for suggestions.
This project is MIT licensed