MCPcopy Create free account
hub / github.com/microsoft/SandDance / getNodeFromInstance$1

Function getNodeFromInstance$1

docs/external/js/react-dom.development.js:8062–8076  ·  view source on GitHub ↗

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

(inst)

Source from the content-addressed store, hash-verified

8060 */
8061
8062 function getNodeFromInstance$1(inst) {
8063 if (inst.tag === HostComponent || inst.tag === HostText) {
8064 // In Fiber this, is just the state node right now. We assume it will be
8065 // a host component or host text.
8066 return inst.stateNode;
8067 } // Without this first invariant, passing a non-DOM-component triggers the next
8068 // invariant for a missing parent, which is super confusing.
8069
8070
8071 {
8072 {
8073 throw Error( "getNodeFromInstance: Invalid argument." );
8074 }
8075 }
8076 }
8077 function getFiberCurrentPropsFromNode$1(node) {
8078 return node[internalEventHandlersKey] || null;
8079 }

Callers 2

getInstIfValueChangedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected