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

Disconnect event listeners on unmount #235

Open
LPGhatguy opened this issue Sep 10, 2019 · 0 comments · May be fixed by #282
Open

Disconnect event listeners on unmount #235

LPGhatguy opened this issue Sep 10, 2019 · 0 comments · May be fixed by #282
Labels

Comments

@LPGhatguy
Copy link
Contributor

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.

@LPGhatguy LPGhatguy added the bug label Sep 10, 2019
@jeparlefrancais jeparlefrancais linked a pull request Jul 8, 2020 that will close this issue
3 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant