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

Function commitAttachRef

code/new-context-api/public/app.js:10750–10774  ·  view source on GitHub ↗
(finishedWork)

Source from the content-addressed store, hash-verified

10748 }
10749
10750 function commitAttachRef(finishedWork) {
10751 var ref = finishedWork.ref;
10752 if (ref !== null) {
10753 var _instance5 = finishedWork.stateNode;
10754 var instanceToUse = void 0;
10755 switch (finishedWork.tag) {
10756 case HostComponent:
10757 instanceToUse = getPublicInstance(_instance5);
10758 break;
10759 default:
10760 instanceToUse = _instance5;
10761 }
10762 if (typeof ref === 'function') {
10763 ref(instanceToUse);
10764 } else {
10765 {
10766 if (!ref.hasOwnProperty('current')) {
10767 warning(false, 'Unexpected ref object provided for %s. ' + 'Use either a ref-setter function or React.createRef().%s', getComponentName(finishedWork), getStackAddendumByWorkInProgressFiber(finishedWork));
10768 }
10769 }
10770
10771 ref.current = instanceToUse;
10772 }
10773 }
10774 }
10775
10776 function commitDetachRef(current) {
10777 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