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

Function getInstanceFromNode$1

code/new-context-api/public/app.js:1831–1841  ·  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

1829 * instance, or null if the node was not rendered by this React.
1830 */
1831function getInstanceFromNode$1(node) {
1832 var inst = node[internalInstanceKey];
1833 if (inst) {
1834 if (inst.tag === HostComponent || inst.tag === HostText) {
1835 return inst;
1836 } else {
1837 return null;
1838 }
1839 }
1840 return null;
1841}
1842
1843/**
1844 * Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding

Callers 1

app.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected