Is there a way to detect DOM is rendered on a React based page by external JavaScript? I would like to access/get DOM elements in an external JavaScript file after DOM is rendered by React.
My idea is using custom event and use it in EventListener but would like to know if there is another way. Thanks!
// React
componentDidMount() {
document.dispatchEvent('didmount')
}
// external JavaScript
document.addEventListener('didmount', () => {...})