-
Notifications
You must be signed in to change notification settings - Fork 0
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源码解析——ReactDOM #18
Labels
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
第二章 react 创建更新的过程
2.1 创建更新方式
ReactDOM.render
步骤:创建 ReactRoot->创建 FiberRoot 和 RootFiber->创建更新,进入调度
入口
react-src-clients-ReactDom.js->react-reconciler-src-ReactFiberReconciler.js
2.2 FiberRoot
###什么是 FiberRoot
入口
ReactDom.js->ReactFiberReconciler.js->ReactFiberRoot.js
FiberRoot 对象
2.3Fiber-核心
什么是 fiber
2.4 update
什么是 update
2.5 expireationTime(异步)
原因:重复调用 setstate,expiration 结果会不同,会导致 react 多次渲染,影响性能。-> 类似 debounce 防抖???
提高性能,重复调用 setState 时,在 bucketSizeMs 内 expiration 结果是一个,react 只渲染一次
入口
ReactFiberExpirationTime.js
2.6 不同的 expireationTime
种类:
2.7 setState & foreUpdate
核心:
入口
react-reconciler>ReactFiberClassComponent.js
解析
The text was updated successfully, but these errors were encountered: