A boilerplate and reference implementation for mobile applications built with React, Redux, and React Native.
- Node.js v10+ + Yarn
- React Native CLI (
npm -g install react-native-cli
) - Xcode Command Line tools (
xcode-select --install
) - CocoaPods (
gem install cocoapods
) - xcpretty (
gem install xcpretty
) - Bash v4 (default on GNU/Linux,
brew install bash
on macOS)
# install dependencies
yarn install
# run bundler
yarn run serve
# run on Android device/emulator
yarn run android
# run on iOS device/simulator
yarn run ios
# run tests
yarn run test
# lint code
yarn run lint
# format code
yarn run format
From DevTools
// use logger
Logger.debug('Hello World!');
// check if there is an authenticated session
AuthService.isAuthenticated();
// get state from Redux store
$store.getState().MyModule.myField;
// dispatch action from Redux store
$store.dispatch($state.MyModule.$myAction(/* args */));
Assuming target application with following properties:
- code name is
MyApp
- display name is
My App
- pacakge id is
com.myapp.client
-
Initialize your application
react-native init
react-native init MyApp --version 0.58.4 --skip-jest --template 'https://github.com/naderio/helloworld-react-native'
-
Run post-init routine
cd ./MyApp ./postinit.sh 'MyApp' 'My App' 'com.myapp.client'
-
Make sure to replace placeholders (look for
@{
) with appropriate values