Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix lifecycle ordering bug removing recently added container #33

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MellowMelon
Copy link

In React 16, when swapping in components, componentWillMount now fires on the new components before componentWillUnmount fires on the old ones. This means that unmounting a GatewayDest and mounting one of the same name will call addContainer and removeContainer in the wrong order. As a result, the GatewayDest no longer receives updates from rerendered Gateways.

This PR makes it so that removeContainer checks what container it is removing and noops if it would remove the wrong container.

@csardinha
Copy link

Hi,
This solves my case (gateways were keeping the previous content plus the new one >.<).
I need this fix, will it be merged?
Thanks.

@tajo
Copy link
Contributor

tajo commented May 12, 2018

Hey, could you write a test for this?

nathanchrs added a commit to Dekoruma/react-gateway that referenced this pull request Jul 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants