版权归作者所有,转载请注明出处
<p>shouldComponent 可以与 PureComponent一块使用
答案解析:
不能一块用,PureComponent具备浅比较与shouldComponent 功能相似</p>
答案解析:
可以通过activeClassName设置选中的样式
答案解析:
history
14.React 组件被挂载到页面时,被执行的生命周期函数包括?
答案解析:
componentDidMount和render函数都是挂载阶段执行的钩子
答案解析:
componentDidMount是表示组件挂载结束可以获得真实DOM,componentDidUpdate表示组件更新结束,也可以获得
16.constructor函数可以完成以下那些任务
答案解析:
constructor可以通过this.state来设置初始状态,可以通过this.hander = this.hander.bind(this)来绑定方法