MCPcopy Index your code
hub / github.com/caseywebdev/react-list / commitAttachRef

Function commitAttachRef

docs/index.js:29699–29721  ·  view source on GitHub ↗
(finishedWork)

Source from the content-addressed store, hash-verified

29697 );
29698 }
29699 function commitAttachRef(finishedWork) {
29700 var ref = finishedWork.ref;
29701 if (null !== ref) {
29702 var instance = finishedWork.stateNode;
29703 if ("function" === typeof ref)
29704 if (shouldProfile(finishedWork))
29705 try {
29706 startEffectTimer(), (finishedWork.refCleanup = ref(instance));
29707 } finally {
29708 recordEffectDuration();
29709 }
29710 else finishedWork.refCleanup = ref(instance);
29711 else
29712 "string" === typeof ref
29713 ? console.error("String refs are no longer supported.")
29714 : ref.hasOwnProperty("current") ||
29715 console.error(
29716 "Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().",
29717 getComponentNameFromFiber(finishedWork)
29718 ),
29719 (ref.current = instance);
29720 }
29721 }
29722 function safelyAttachRef(current, nearestMountedAncestor) {
29723 try {
29724 runWithFiberInDEV(current, commitAttachRef, current);

Callers

nothing calls this directly

Calls 4

shouldProfileFunction · 0.85
startEffectTimerFunction · 0.85
recordEffectDurationFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…