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

Function getInstanceFromNode$1

code/communication/public/app.js:2505–2515  ·  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

2503 * instance, or null if the node was not rendered by this React.
2504 */
2505function getInstanceFromNode$1(node) {
2506 var inst = node[internalInstanceKey];
2507 if (inst) {
2508 if (inst.tag === HostComponent || inst.tag === HostText) {
2509 return inst;
2510 } else {
2511 return null;
2512 }
2513 }
2514 return null;
2515}
2516
2517/**
2518 * Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding

Callers 1

app.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected