A boilerplate and reference implementation for mobile applications built with React, Redux, and React Native.
- Node.js
- 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
npm install
# run bundler
npm start
# run on Android device/emulator
npm run android
# run on iOS device/simulator
npm run ios
# run tests
npm run test
# lint code
npm run lint
# format code
npm 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
export \ TEMPLATE_RN_VERSION='0.64.1' \ TEMPLATE_CODE_NAME='MyApp' \ TEMPLATE_DISPLAY_NAME='My App' \ TEMPLATE_PACKAGE_ID='com.myapp.client' \ ; npx react-native init $TEMPLATE_CODE_NAME --npm --version $TEMPLATE_RN_VERSION --template 'https://github.com/naderio/helloworld-react-native'
-
Make sure to replace placeholders (look for
@{
) with appropriate values