MCPcopy Create free account
hub / github.com/krasimir/react-in-patterns / getInstanceFromNode$1

Function getInstanceFromNode$1

code/styling/public/app.js:2470–2480  ·  view source on GitHub ↗

* Given a DOM node, return the ReactDOMComponent or ReactDOMTextComponent * instance, or null if the node was not rendered by this React.

(node)

Source from the content-addressed store, hash-verified

2468 * instance, or null if the node was not rendered by this React.
2469 */
2470function getInstanceFromNode$1(node) {
2471 var inst = node[internalInstanceKey];
2472 if (inst) {
2473 if (inst.tag === HostComponent || inst.tag === HostText) {
2474 return inst;
2475 } else {
2476 return null;
2477 }
2478 }
2479 return null;
2480}
2481
2482/**
2483 * Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding

Callers 1

app.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected