Skip to content
This repository was archived by the owner on Dec 13, 2023. It is now read-only.
This repository was archived by the owner on Dec 13, 2023. It is now read-only.

Disconnect event listeners on unmount #235

@LPGhatguy

Description

@LPGhatguy

We don't currently disconnect events before we start unmounting host components.

This means that you can get event callbacks during unmounting, which means that refs are generally nil, you can't call setState, and generally things are in weird states.

We should update RobloxRenderer.unmountHostNode to iterate through all Roact.Event and Roact.Change props and disconnect them.

There may be cases in existing Roact projects where layout events are firing as children are being destroyed, and we might be doing a significant number of extraneous size changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions