Closed ghost closed 7 years ago
As pointed out in #3, React calls the ref with null when a component unmounts:
null
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.
Got it, thanks @MoeSattler!
As pointed out in #3, React calls the ref with
null
when a component 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.