Reputation: 21
How React Virtual DOM works with third party js plugins? For instance , If we use leaflet or jquery libs which will directly communicates with real dom Then how react virtual dom handle these real dom manipulations.
Upvotes: 2
Views: 157
Reputation: 2424
jQuery interacts with DOM, then the only way to interact with it is ensuring your component is mounted (displayed into the DOM)
You can use componentDidMount()
function to execute your jQuery code.
Upvotes: 1
Reputation: 129
first of all, I don't see a good reason to have React + jQuery, if you are starting a new project and you want to use React or jQuery, go ahead and choose one of them. but in case you are willing to use them together here is one of the articles I recommend before going into this direction.
Upvotes: 2