问答题 · 前端 · react · @{ formatTime(detail.create_time) }
shouldComponentUpdate 是做什么的?
shouldComponentUpdate 这个方法用来判断是否需要调用 render 方法重新描绘 dom。因为 dom 的描绘非常消耗性能,如果我们能在 shouldComponentUpdate 方法中能够写出更优化的 dom diff 算法,可以极大的提高性能。
微信小程序:前端开发宝典
记住密码 忘记密码