很多时候,使用React Native AsyncStorage很难调试,既没有命令行也没有UI界面,尤其是在真机调试阶段,无法确保AsyncStorage里存储的数据是否可用,因此构建了UI Debugger显得十分必要, RN-COOK就是这么一款调试工具。
使用:
$ npm install rn-cook --save //1) install module $ npm install rn-cook --save //2) import module import RNCook from 'rn-cook'; //3) write component on bottom of view container <RNCook/> //4) for example <ScrollView style={styles.flex_1}> <View style={styles.logo}></View> <Text style={styles.fontTitle}> Read </Text> <Recommend/> <View style={styles.hr}></View> <Text style={styles.fontTitle}> Study </Text> <Grade navigator={this.props.navigator}/> <View style={styles.hr}></View> <Text style={styles.fontTitle}> Category </Text> <Category navigator={this.props.navigator}/> <CopyRight navigator={this.props.navigator}/> <RNCook/> </ScrollView>
截图展示: