react-native-navigation-starter
Simple yet practical starter with React Native Navigation v6, 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 class MyComponent extends React.Component { ... }, only functions with React Hooks and native navigation. The app logic is written in two ways: using MobX-State-Tree in /srcMobX folder and using Redux with hooks 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 v6 - 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
and pick your favourite state management tool (examples inside)
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 |
Getting Started
- Clone the repo
git clone https://github.com/kanzitelli/react-native-navigation-starter.git new-project
- Install packages
cd new-project
yarn
npx pod-install
-
Rename the app using react-native-rename if needed. If you do so, don't forget to run
npx pod-install
when the process is finished. Also keep in mind that bundle identifier must be valid for both platforms or change it manually. -
Run it!
yarn ios
yarn android
Todos
There are still some things I would like to add to the starter:
- Notifications by Wix.
- Continous delivery via Codepush.
- Dark Mode via react-native-dark-mode.
- Localization via i18next.
- Maybe something else. Feel free to open an issue for suggestions.