//
// author:Evan
// date: ${DATE}
//
// desc:$Description
//
import React,{PropTypes, Component}from 'react';
import {
StyleSheet,
View,
} from 'react-native';
type Props = {
}
type State = {
}
export default class $NAME extends Component<Props, State> {
constructor(props: Props) {
super(props);
this.state = {
}
}
/**
* 初始化了状态之后,在渲染前调用,在第一次绘制 render() 之前
* 这个函数也是只被调用一次,setState()无法再次调用
*/
componentWillMount(){
}
/**
* 这个函数开始,就可以和 JS 其他框架交互了,例如设置计时 setTimeout 或者 setInterval,
* 或者发起网络请求。这个函数也是只被调用一次
*/
componentDidMount(){
}
/**
* 输入参数 nextProps 是即将被设置的属性,旧的属性还是可以通过 this.props 来获取。在这个回调函数里面,你可以根据属性的变化,
* 通过调用 this.setState() 来更新你的组件状态,这里调用更新状态是安全的,并不会触发额外的 render()
* (在外部能够使用setState()来改变属性 多次调用)
* 这个方法在初始化render时不会被调用。
*/
componentWillReceiveProps(){
}
/**
* 返回一个布尔值。在组件接收到新的props或者state时被调用。在初始化时或者使用forceUpdate时不被调用。
* 可以在你确认不需要更新组件时使用。
shouldComponentUpdate(){
}
*/
/**
* 如果组件状态或者属性改变,并且 shouldComponentUpdate(...) 返回为 true,就会开始准更新组件
* 在初始化时不会被调用
*/
componentWillUpdate(){
}
/**
* 调用了 render() 更新完成界面之后,会调用 componentDidUpdate() 来得到通知
* 在组件完成更新后立即调用。在初始化时不会被调用。
*/
componentDidUpdate(){
}
/**
* 在组件从 DOM 中移除的时候立刻被调用
*/
componentWillUnmount(){
}
render() {
return (
<View>
</View>
);
}
}
const styles = StyleSheet.create({
});
网友评论