题目描述:
在城市浮层的开发过程中,我们编写了多个层次的组件,并且都有用 memo。那么你知道什么时候该用 memo 而什么时候不能用 memo 吗?memo 和 shouldComponentUpdate 有什么关系?又如何自定义 diff 算法呢?memo 的本质都是什么呢?
关键提炼:
1、React.memo is a higher order component: https://reactjs.org/docs/react-api.html#reactmemo
2、Optimizing Performance: https://reactjs.org/docs/optimizing-performance.html
【讨论题】城市选择浮层-字母快速定位
959
等3人参与
全部作业
state是react中可变状态,可以在class组件中使用setState更新,state的更新会带动视图的更新,而ref的修改不会
0
提交于 2022-08-18 22:51:58
登录后即可查看更多作业,立即登录
数据加载中...