- Standard compliant React Native App Utilizing Ignite
Step 1: git clone this repo:
Step 2: cd to the cloned repo:
Step 3: Install the Application with yarn
or npm i
- cd to the repo
- Run Build for either OS
- for iOS
- run
react-native run-ios
- If this fails with Simulator not found use
react-native run-ios --simulator="iPhone **MODEL**"
- run
- for Android
- Run Genymotion
- run
react-native run-android
This project adheres to Standard. Our CI enforces this, so we suggest you enable linting to keep your project compliant during development.
To Lint on Commit
This is implemented using husky. There is no additional setup needed.
Bypass Lint
If you have to bypass lint for a special commit that you will come back and clean (pushing something to a branch etc.) then you can bypass git hooks with adding --no-verify
to your commit command.
Understanding Linting Errors
The linting rules are from JS Standard and React-Standard. Regular JS errors can be found with descriptions here, while React errors and descriptions can be found here.
This project uses react-native-config to expose config variables to your javascript code in React Native. You can store API keys
and other sensitive information in a .env
file:
API_URL=https://myapi.com
GOOGLE_MAPS_API_KEY=abcdefgh
and access them from React Native like so:
import Secrets from 'react-native-config'
Secrets.API_URL // 'https://myapi.com'
Secrets.GOOGLE_MAPS_API_KEY // 'abcdefgh'
The .env
file is ignored by git keeping those secrets out of your repo.
- Copy .env.example to .env
- Add your config variables
- Follow instructions at https://github.com/luggit/react-native-config#setup
- Done!
- Generate the js bundle
react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
- enter android directory and assemble debug apk (unsigned)
cd android
./gradlew assembleDebug
- Send generated APK from
app/build/outputs/apk/debug/<version>.apk
- Ensure version upgrade
react-native-version --never-amend
This will update app version in IOS and Android Manifests
- Build app using gradle
cd android
./gradlew assembleDebug
- Build using android runner if build fails
react-native run-android --variant=release
- Send generated APK from
app/build/outputs/apk/release/<version>.apk