We ' ll download the requirements for getting started and React Native, refactor our app to ES6, walk through debugging, an D Talk about the philosophy behind React and React Native.
Install:
Install -- Install install-G REACT-NATIVE-CLI
Create a project:
React-native Init Githubnotepicker
Run the project:
CD githubnotepickerreact-native Run-ios
The simulator is pop up.
Enable the hot reload:
CMD + D-and enable hot reload
After that, once the code, the app would reload automatically.
Debugger:
class Githubnotetaker extends Component {render () {name= "Zhentian"; Debugger; return ( <view style={styles.container}> <text style={styles.welcome}>Welcome to React Native! </Text> <text style={styles.instructions}>to get started, edit Index.ios.js</Text> <text style={styles.instructions}>Press CMD+r to reload,{' \ n '} CMD+d or Shake forDev Menu</Text> </View> ); }}
We Add a ' debugger ' there. "CMD + D"---Enable remote JS debugging.
Then refresh the page and you'll see a page pops up and then open the Debug tool. Then you can debug as the Web.
[React Native] Up and Running