React-常见优化技术

一、使用shouldComponentUpdate

返回false,则页面不进行渲染,返回true,页面才进行渲染

二、class组件使用PureComponent(注意PureComponent是浅比较)

三、function组件使用memo(注意memo也是浅比较)

发布了35 篇原创文章 · 获赞 1 · 访问量 6718

猜你喜欢

转载自blog.csdn.net/qq_36162529/article/details/102683184