With jQuery, I can attach an event handler function via the on method that will be triggered also when the DOM change and something (like an Ajax call) replace the HTML of the page.
Is it possible to do something similar with a React component? After an ajax call that changes the DOM, if an element with a specific class is found, render it (with ReactDOM.render(...)).
Thanks
The component render responsibility should be given to react. Hence you should store the response from ajax call in the current state and react will handle the component rendering based on current state.
Follow these APIs if you are using only react
https://facebook.github.io/react/docs/component-api.html
or follow connect() if you are writing in react-redux
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