-
-
Notifications
You must be signed in to change notification settings - Fork 53.5k
Closed
Description
- I have searched the issues of this repository and believe that this is not a duplicate.
Reproduction link
Steps to reproduce
- 需要很多的表格组件
- 点击案例中的切换按钮
- 会发现页面出现卡顿,然后才能看到切换后的文案
What is expected?
- 点击切换不卡顿
What is actually happening?
- 点击切换卡顿
Environment | Info |
---|---|
antd | 4.18.2 |
React | 18.0.0 |
System | windows 10 |
Browser | chrome浏览器 |
- 根据性能工具的简单调查,会发现table组件在卸载的时候,会触发这里代码去获取dom元素的scrollLeft,导致重排
- 想了解一下为什么要在unmount的时候需要重新获取scrollLeft,看注释说明的话,获取滚动条位置并不需要在卸载时去获取,那到底是为啥呢?