- 【强制】对组件引用,变量引用,需遵从以下方式;
```
import React, {Component} from 'react';
import{
View,
Text,
TouchableHighlight,
Image,
StyleSheet,
InteractionManager,
} from 'react-native';
//from react,react-native优先;
//from npm库其次;
import { connect } from 'react-redux';
//from 项目内组件其次;
import LoadingAndTime from '../component/LoadingAndTime';
import { performLoginAction } from '../action/LoginAction'
import {encode} from '../common/Base64';
//变量初始化,常量初始化 最后;
let screenWidth = Dimensions.get('window').width;
let screenHeight = Dimensions.get('window').height;
let typeCode = Platform.OS == 'android' ? 'android-phone' : 'ios-phone'
let selectColor=Platform.OS=='android'?null:'white'
```
- 【推荐】对组件引用,变量初始化等,在整个页面或组件内未使用,因去除相关代码;
- 【推荐】某些全局变量请不要使用global,需新建文件进行导出引用; NetUtil.get(global.url + “”)
- 【推荐】render()函数代码过长时,请适当进行拆分,拆分为‘‘页面内组件‘‘,提高可读性。render()函数代码行请勿超过八十行,超过之后,请自行进行拆分;