react-native
android
ios
- navigation:
react-native-router-flux
- state handling:
redux
react-redux
- redux async middleware:
redux-thunk
- database:
firebase
We recommend installing Node and Watchman using Homebrew. Run the following commands in a Terminal after installing Homebrew:
brew install node
brew install watchman
Run the following command in a Terminal:
npm install -g react-native-cli
Run react-native run-ios inside your React Native project folder:
cd AwesomeProject
react-native run-ios
- Used for presenting static data
- Can't handle fetching data
- Easy to write
const Header = () => {
return <Text> Fathan is cool </Text>
}
- Used for dynamic source of data
- Handles any data that might change (fetching data, user event, etc)
- Knows when it gets rendered to the devices (useful for data fetching)
- More code to write
class Header extends Component {
render() {
return <Text> Jan is not cool </Text>
}
}
State: a plain javascript object used to record and respond to user-trigerred events.
When we need to update what a component shows, call
this.setState
notthis.state
npm install -g yo generator-rn-toolbox
brew install imagemagick
- Have a single icon file (200x200px is sufficient).
- In project directory, run:
yo -rn-toolbox:assets --icon <path to the icon>
#example:
yo rn-toolbox:assets --icon ../icon.png
- Set the icon from XCode or Android Studio