> After peeling through the React codebase
Except you don't have to peel through their code base or intercept any calls, they expose a clean interface for this: https://github.com/facebook/react-devtools
You can capture it like this:
window.__REACT_DEVTOOLS_GLOBAL_HOOK__.inject = function(obj) {
// obj.Mount
}
Which is how we're doing SSR at https://www.prerender.cloud/ for compatibility across React versions.