zoukankan      html  css  js  c++  java
  • [React Native] Up and Running

    We'll download the requirements for getting started with React Native, refactor our app to ES6, walk through debugging, and talk about the philosophy behind React and React Native.

    Install:

    brew install --HEAD watchman
    brew install flow
    
    npm install -g react-native-cli

    Create a project:

    react-native init githubnotepicker

    Run the project:

    cd githubnotepicker
    react-native run-ios

    The simulator will pop up.

    Enable the hot reload:

    cmd + D -->  enable hot reload

    After that, once you change the code, the app will 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,{'
    '}
              Cmd+D or shake for dev menu
            </Text>
          </View>
        );
      }
    }

    We add a 'debugger' there. "cmd + D" --> Enable remote JS debugging. 

    Then refresh the page, you will see a page pop up, then open the debug tool. Then you can debug as you do on the web.

  • 相关阅读:
    Java初始化顺序
    生产者与消费者
    Java线程
    思科QoS知识全面了解
    思科3750交换机堆叠配置指南
    Cisco VRRP Config Case1
    思科交换机快速定位流量异常端口
    QoS笔记
    Cisco BGP团体配置要领
    Cisco BGP Local_Pref配置要领
  • 原文地址:https://www.cnblogs.com/Answer1215/p/5690269.html
Copyright © 2011-2022 走看看