rsuite / rsuite-table

A React table component.
https://table.rsuitejs.com/
MIT License
725 stars 133 forks source link

Memory leak when use virtualized #477

Open Ashiria7 opened 10 months ago

Ashiria7 commented 10 months ago

Versions

package version
react X.Y.Z
rsuite-table X.Y.Z

What is the expected behavior?

What is the current behavior?

What are the steps to reproduce?

使用文档中的virtualized例子,打开devtool -> memory,不断向下滚动,生成一个内存快照,即可看到大量的已分离Dom对象; image 目前定位到的代码在 https://github.com/rsuite/rsuite-table/blob/acd24e0d0fa1f71fe6eed774d21a33e01fe225bb/src/utils/useTableRows.ts#L24 这个对象记录了所有行的Dom对象以及RowData,包括已经卸载的,并且目前看来没有清除的时机,除非整个table卸载

Any additional comments? (optional)