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

Function getNodeFromInstance$1

code/redux/public/app.js:2737–2747  ·  view source on GitHub ↗

* Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding * DOM node.

(inst)

Source from the content-addressed store, hash-verified

2735 * DOM node.
2736 */
2737function getNodeFromInstance$1(inst) {
2738 if (inst.tag === HostComponent || inst.tag === HostText) {
2739 // In Fiber this, is just the state node right now. We assume it will be
2740 // a host component or host text.
2741 return inst.stateNode;
2742 }
2743
2744 // Without this first invariant, passing a non-DOM-component triggers the next
2745 // invariant for a missing parent, which is super confusing.
2746 invariant(false, 'getNodeFromInstance: Invalid argument.');
2747}
2748
2749function getFiberCurrentPropsFromNode$1(node) {
2750 return node[internalEventHandlersKey] || null;

Callers 2

getInstIfValueChangedFunction · 0.70
app.jsFile · 0.70

Calls 1

invariantFunction · 0.70

Tested by

no test coverage detected