react-native 生命周期
2017-10-26 17:24
323 查看
react-native 生命周期
1.创建阶段
1.getDefaultProps() 处理外部传进来的属性,建议使用static defaultProps = { title: '', // 标题 };
2.实例化阶段
1.render() 启动之后,渲染布局2.getInitialState() 初始化组件的state值,建议使用
constructor(props) { super(props); // 设置state的值 this.state = { isOn: false, }; }
3.componentWillMount() 在render之前调用此方法,如处理state的操作
4.componentDidMount() 在render之后调用
5.componentWillUnmount()组件将要被卸载
componentWillUnmount() { }
相关文章推荐
- react native Component 生命周期
- React Native Component 生命周期
- React Native生命周期整理
- React Native 中组件的生命周期
- React Native 中 component 生命周期
- React Native组件的生命周期及属性props
- React Native 中组件的生命周期
- React Native 学习-组件说明和生命周期
- React Native 中 component 生命周期
- 【RN - 基础】之React Native组件的生命周期
- React Native 生命周期
- React Native组件的生命周期
- React Native实战之ReactJS组件生命周期
- React Native 中组件的生命周期
- React Native 中 component 生命周期
- React Native 中组件的生命周期
- react-native--生命周期
- React Native 中 component 生命周期
- React Native 中组件的生命周期
- React Native之生命周期