For the purposes of debugging in the console, is there any mechanism available in React to use a DOM element instance to get the backing React component?
This questi
Here you go. This supports React 16+
window.findReactComponent = function(el) { for (const key in el) { if (key.startsWith('__reactInternalInstance$')) { const fiberNode = el[key]; return fiberNode && fiberNode.return && fiberNode.return.stateNode; } } return null; };