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

Function safelyDetachRef

docs/index.js:11091–11112  ·  view source on GitHub ↗
(current, nearestMountedAncestor)

Source from the content-addressed store, hash-verified

11089 }
11090}
11091function safelyDetachRef(current, nearestMountedAncestor) {
11092 var ref = current.ref,
11093 refCleanup = current.refCleanup;
11094 if (null !== ref)
11095 if ("function" === typeof refCleanup)
11096 try {
11097 refCleanup();
11098 } catch (error) {
11099 captureCommitPhaseError(current, nearestMountedAncestor, error);
11100 } finally {
11101 (current.refCleanup = null),
11102 (current = current.alternate),
11103 null != current && (current.refCleanup = null);
11104 }
11105 else if ("function" === typeof ref)
11106 try {
11107 ref(null);
11108 } catch (error$112) {
11109 captureCommitPhaseError(current, nearestMountedAncestor, error$112);
11110 }
11111 else ref.current = null;
11112}
11113function commitHostMount(finishedWork) {
11114 var type = finishedWork.type,
11115 props = finishedWork.memoizedProps,

Calls 5

captureCommitPhaseErrorFunction · 0.85
shouldProfileFunction · 0.85
startEffectTimerFunction · 0.85
runWithFiberInDEVFunction · 0.85
recordEffectDurationFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…