Skip to content

lastNativeEvent retains unmounted elements & fibers #17580

Description

@bgirard

I'm seeing memory kept around for longer then it needs to by lastNativeEvent:
https://github.com/facebook/react/blob/26ba38ae4b65375b97b561ec2d6a58ef597647ed/packages/react-dom/src/events/EnterLeaveEventPlugin.js#L49

In my case it's holding on to detached DOM nodes/Fiber.

I think we should be able to use WeakSet since we're doing a === check. Otherwise we should consider timing it out in some way.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions