I'm trying to write a plugin for a webpage that uses React. I have access to React
and ReactDOM
.
I need to find all instances of the PageWrapper
React component for this particular page.
I can do this using the React dev tools for Google Chrome with the search bar, but I want to be able to do this in JavaScript.
Is there any way of doing this in JavaScript? Something like FindAllInstancesOfReactComponent(tagName)
would be perfect.
You may try using reactDOM.
ReactDOM.findDOMNode(component)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.