-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[React] react组件重复渲染 #216
Comments
组件本身使用 useState 或 useReducer 更新,引起的 re-render 常规使用:
|
immutation state
|
强制更新
|
父组件更新引起子组件的 re-render
|
父组件更新引起子组件的 re-render - 优化组件设计
|
将不需要 re-render 的部分抽离,以插槽形式渲染(children)
|
React.memo
|
React.memo 引用类的 props, 添加事件处理的函数
|
useCallback
|
useCallback use state
|
useCallback use state fix - 会导致闭包问题,子组件重复渲染
|
useRef & useEffect
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
深入 React 函数组件的 re-render 原理及优化
The text was updated successfully, but these errors were encountered: