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

Function getInstanceFromNode$1

code/composition/public/app.js:2608–2618  ·  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

2606 * instance, or null if the node was not rendered by this React.
2607 */
2608function getInstanceFromNode$1(node) {
2609 var inst = node[internalInstanceKey];
2610 if (inst) {
2611 if (inst.tag === HostComponent || inst.tag === HostText) {
2612 return inst;
2613 } else {
2614 return null;
2615 }
2616 }
2617 return null;
2618}
2619
2620/**
2621 * Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding

Callers 1

app.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected