Follow the React Native setup process.
You'll need Nodejs version ^5.5.0 and npm version ^3.0.0. Use n to manage Node versions.
npm install gulp -g
npm i
Install the React Native Package Manager:
npm install rnpm -g
Link the project's native module dependencies (more info here):
rnpm link
React Native is under (very) active development so may need to be upgraded to get access to new APIs, views and fixes etc.
cd <this-project>
npm install --save react-native@<version>
react-native upgrade
See upgrading React Native for more info.
Start the React packager
npm start
Run the project:
npm run ios
Launch the emulator:
Click 'Run'
Hit cmd+d
and 'Enable Live Reload'
Launch the emulator:
npm run android-emu
Run the project:
npm run android
Logs:
npm run android-logs
Shake the device fn+F2
and 'Enable Live Reload'
Packages should be automatically linked to the iOS/Android projects thanks to the postinstall
script that'll execute when you run npm install
. If you have any problems, try running rnpm link [package-name]
manually.
Execute all tests:
npm test
npm run generate
The project has its own .babelrc
configuration file to define transforms used by processes outside of React Native - like tests and Gulp tasks that need to be compiled to ES5. However, RN will recognise that this file exists and use it instead of its own instance. This can cause issues if the project config does not include all the transforms required by RN. To ensure conflicts don't arise, the local Babel config extends the RN one:
{
"extends": "react-native/packager/react-packager/.babelrc",
...
}
NOTE: this will need to be changed when next upgrading React Native.
- Upgrade to v0.23
- Optimisation
- StorageService -> hydrate state from AsyncStorage
- Scalable structure
- Saga tests