Skip to content

Memory leak when use virtualized #477

@Ashiria7

Description

@Ashiria7

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
目前定位到的代码在

const tableRows = useRef<{ [key: string]: [HTMLElement, any] }>({});

这个对象记录了所有行的Dom对象以及RowData,包括已经卸载的,并且目前看来没有清除的时机,除非整个table卸载

Any additional comments? (optional)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions