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

Add null check to prevent error when unmounting #5

Merged
merged 1 commit into from Dec 3, 2016
Merged

Add null check to prevent error when unmounting #5

merged 1 commit into from Dec 3, 2016

Conversation

ghost
Copy link

@ghost ghost commented Nov 6, 2016

As pointed out in #3, React calls the ref with null when a component unmounts:

React will call the ref callback with the DOM element when the component mounts, and call it with null when it unmounts.

This causes react-elm-components to break, since it will try to mount the app on the node provided by the callback.

This PR fixes that by adding a simple null check.

@rtfeldman
Copy link
Contributor

Got it, thanks @MoeSattler!

@rtfeldman rtfeldman merged commit a0eb110 into cultureamp:master Dec 3, 2016
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.

2 participants