MCPcopy Index your code
hub / github.com/krasimir/react-in-patterns / commitAttachRef

Function commitAttachRef

code/composition/public/app.js:11527–11551  ·  view source on GitHub ↗
(finishedWork)

Source from the content-addressed store, hash-verified

11525 }
11526
11527 function commitAttachRef(finishedWork) {
11528 var ref = finishedWork.ref;
11529 if (ref !== null) {
11530 var _instance5 = finishedWork.stateNode;
11531 var instanceToUse = void 0;
11532 switch (finishedWork.tag) {
11533 case HostComponent:
11534 instanceToUse = getPublicInstance(_instance5);
11535 break;
11536 default:
11537 instanceToUse = _instance5;
11538 }
11539 if (typeof ref === 'function') {
11540 ref(instanceToUse);
11541 } else {
11542 {
11543 if (!ref.hasOwnProperty('current')) {
11544 warning(false, 'Unexpected ref object provided for %s. ' + 'Use either a ref-setter function or React.createRef().%s', getComponentName(finishedWork), getStackAddendumByWorkInProgressFiber(finishedWork));
11545 }
11546 }
11547
11548 ref.current = instanceToUse;
11549 }
11550 }
11551 }
11552
11553 function commitDetachRef(current) {
11554 var currentRef = current.ref;

Callers 1

commitAllLifeCyclesFunction · 0.70

Calls 4

warningFunction · 0.85
refFunction · 0.70
getComponentNameFunction · 0.70

Tested by

no test coverage detected