Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const findComponentAndNode = target => {
let node = target
let component
while (node) {
component = componentByNodeRegistery.get(node)
if (component) return { component, node }
node = node.parentNode
}
return { component: undefined, node: undefined }
}