ku8ar
ku8ar

Reputation: 217

Is there any way to detect a change in a DOM tree that does not come directly from React?

I mean the case when an independent script (like jQuery) changes something on the page rendered by React.

Maybe React has some function validating vDOM == DOM or calculates internally hash of DOM?

Upvotes: 1

Views: 102

Answers (1)

Rohith Murali
Rohith Murali

Reputation: 5669

Sorry, there is no way to do that.

"React is unaware of changes made to the DOM outside of React. It determines updates based on its own internal representation, and if the same DOM nodes are manipulated by another library, React gets confused and has no way to recover."

You can read the same in react documentation for the support of external libraries for dom manipulation.

Upvotes: 2

Related Questions