ReactNativeDevelopmentGuide
ReactNativeDevelopmentGuide copied to clipboard
Enjoy :)
DIVE IN
GETTING STARTED
DEV TOOLS
STARTER KITS
RUN ON A DEVICE
COMMUNITY
SOLIDIFY THE FOUNDATION
JAVASCRIPT
REACT
COMPONENTS
-
Native, not web components e.g.
not Building blocks of React Native app
Has JSX, props and state
JSX
-
Write markup language in the codebase
-
Syntax for embedding XML within JavaScript e.g. <Text>Hello world!</Text>
PROPS
-
Set by the parent
-
Fixed throughout lifetime of the app
-
Creation parameters customize components
STATE
-
Track data changes in app
-
Init in constructor, then call setState to update
-
Changes in state trigger RN lifecycle e.g. render() to run again
LIFECYCLE
REDUX
-
Paradigm to manage app state and data flow
-
State management in which actions within a component dispatch transformations of state to reducers and the new state is relayed to subscribed components
MOBILE DEVELOPMENT
-
Note: Caches increase loading times, but may need to be deleted to process project updates. For changes to core app settings like app icon and splash screens, make sure to clear Derived Data in Xcode. iOS Emulators should be reset or uninstall the app. Android emulators also need to be reset as well for updates to app icons/splash screens.
iOS DEVELOPMENT
-
Overview of iOS certificates, identifiers and profiles - Theodo
-
Program to setup iOS certificates, provisioning profiles, TestFlight, Distribution - Apple Developer
-
Xcode: Delete derived data and clean project - iOSDevCenters
-
To reset iOS Emulators:
For Xcode 9, Simulator -> Hardware -> Erase All Content and Settings... For Xcode 8, Simulator > Reset Content and Settings -
Run app simultaneously on multiple iOS simulators - Jesper Lund blog
ANDROID DEVELOPMENT
-
Android permissions in AndroidManifest.xml - Android Developer docs
-
Platform to manage Google Play submission - Android Developer
-
To reset Android emulator:
Add the parameter -wipe-data to commandline when starting an emulator e.g. /Users/YOURNAME/Library/Android/sdk/tools/emulator -avd Nexus_S_API_25 -wipe-data Android Studio -> Tools > Android > AVD Manager -> Select your emulator device -> Wipe data
TESTING
NETWORKING
Libraries like fetch, XMLHttpRequest, axios offer inspection at the JavaScript level which is helpful but don't tell the exact details of each request. To do that we need to inspect network calls on the native level. Charles is pretty easy to setup, even with SSL.
THE NEXT LEVEL
CONTRIBUTE
CUSTOM COMPONENTS
PERFORMANCE
DESIGN AND PROTOTYPING
MOBILE UX/UI
NODE
TOOLS FOR LIBRARY SELECTION
LINKING LIBRARIES
UPGRADING BUILDS
-
Currently updates once a month
-
DO NOT recommend upgrading immediately unless read the release notes and are willing to break a project build. There are typically unforeseen issues with dependencies and 3rd party libraries.
-
DO recommend upgrading immediately if you want to help stabilize the build by reporting bugs and collaborating with the community to create patches. The core team can’t test everything. Why not help fix it?
3rd PARTY LIBRARIES
-
Officially recommended navigation library - react-navigation
-
Select media from device library or camera - react-native-image-picker
-
Google Analytics wrapper - react-native-google-analytics-bridge
-
AWS JS SDK - aws-sdk-js
HOME STRETCH
CREATING AND MANAGING ASSETS
PROJECTS WITHOUT NATIVE MODULES
PUBLISH FOR IOS
-
Update Xcode scheme for project Product -> Scheme -> Edit Scheme -> Run -> Info -> Build Configuration -> Release
-
Ensure certificates are set for Distribution (configure w Apple Developer account)
-
Each new archive sent to the App Store must have an incremental version number e.g. 1.0 -> 1.01 Target PROJECTNAME -> General -> Identity -> Version
-
Update platform to 'Generic iOS Device'
-
Clean the project
-
Product -> Archive
-
Window -> Organizer -> Archives -> PROJECTNAME -> select version -> Upload to App store The process may take a few minutes to complete.
-
The new binary will become available in iTunesConnect.
PUBLISH FOR ANDROID
-
The generated APK is found under PROJECTNAME/android/app/build/outputs/apk/app-release.apk
-
Upload this file to Google Play Console.