react-bootstrap-slider
react-bootstrap-slider copied to clipboard
componentWillUnmount should destroy gracefully
If the component is unmounted before fully rendered, it throws an error...
Resolves the following error:
render.js:69 TypeError: Cannot read property 'destroy' of undefined
at ReactBootstrapSlider.componentWillUnmount (react-bootstrap-slider.js:158)
at ReactCompositeComponent.js:406
at measureLifeCyclePerf (ReactCompositeComponent.js:73)
at ReactCompositeComponentWrapper.unmountComponent (ReactCompositeComponent.js:405)
at Object.unmountComponent (ReactReconciler.js:76)
at Object.unmountChildren (ReactChildReconciler.js:144)
at ReactDOMComponent.unmountChildren (ReactMultiChild.js:369)
at ReactDOMComponent.unmountComponent (ReactDOMComponent.js:992)
at Object.unmountComponent (ReactReconciler.js:76)
at Object.unmountChildren (ReactChildReconciler.js:144)
Thanks for the PR. It passes all tests.
Before I merge, could you tell me under what circumstances you would unmount the component before it's rendered? Maybe supply some example code too.
I'm not doing it intentionally but it is happening when loading inside of react storybook.
It is likely when something starts with any component and internal State change and stops it before it's finished loading, and then perhaps starts again afterwards
Okay, can I see some sample code, please? Do you have a Github project that I can check out?