I have a backbone application, where i am trying to integrate React components.
React component is mounted using following code :
ReactDOM.render(
<WrappedComponent />, node
);
where node is the DOM mode. This way React lifecycle events like componentWillMount and componentDidMount are getting called fine.
But when routing happen through Backbone routing, and React component getting removed from DOM, componentWillUnmount is not invoked.
Any solutions ?
componentWillUnmount
does not get called automatically when the container node gets removed. It only gets called:
ReactDOM.unmountComponentAtNode
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With