A project template which fully configured for production using container pattern, shipped with Typescript to provide strongly type checking
- React navigation
- Redux
- Redux-persist (to persist data when app reload/or goes offline)
- Redux-thunk
- SocketIO (optional)
- Path alias to enable friendly import path (Eg:
import App from '@/components/App'
)
First you need to clone this repo
Then run the following commands:
yarn install
cd ios && pod install
And run as normal React Native project with:
react-native run-ios
react-native run-android
Explain:
- assets: to put images, icons,...
- components: contains reusable components
- containers: components that connect your React components/screens with Redux store
- navigations: contains all your navigation configurations (stack/tab..)
- screens: contains all screens for your app
- services: services that your app needs (axios, navigation service, ...)
- store: your Redux store
- App.tsx: your main application component
- env.ts: contains common variables for your app
Integrate Socket.IO with Redux quite simple. A Socket middleware is declared under /src/store/middlewares/sockets
Socket middleware comes with some samples of usage.
- The
__docs__
folder you can remove it when using - Hermes is enable by default for running on Android to make your app start faster. If you want to disable it, set
enableHermes
tofalse
inandroid/app/build.gradle
- Path alias is set to
@
, if you want to change it then change in bothbabel.config.js
andtsconfig.json