ReactJS :
应用由组件来组成,类似于xml ,非常清晰,每个组件维护自己的状态和UI,改变的时候自动重新渲染
全局对象: React
生命周期:
创建: getDefaultProps : 可以自定义新属性,自动和父组件的属性合并
2 实例化: getInitalstate : 处理this.state属性
3 逻辑处理: componentWillmount
4 render: 根据state渲染虚拟DOM节点并返回虚拟DOM,并将结构返回
5 componentDidMount 使用render方法返回的虚拟DOM对象,来创建真是的DOM,可以通过this.getDOMNode()获取当前组件的节点
更新:
1 componentWillReceiveProps()
2 shouldComponentUpdate()
3 componentWillUpdate()
4 componentDidUpdate()
销毁:
component W illUnmount()