生命周期:
componentWillMount
componentDidMount
componentWillReceiveProps
shouldComponentUpdate
componentWillUpdate
componentDidUpdate
componentWillUnmount
错误处理
componentDidCatch():
react 16 的Portals特性,将组件渲染到当前组件树以外的DOM节点上。例如应用的全局弹框。
ReactDOM.createPortal(child,container)
child:被渲染的react元素
container:一个DOM元素,child被挂载到该DOM元素上。
组件的state、组件与服务器通信、组件通信、组件的ref属性
文章评论