MCPcopy Index your code
hub / github.com/microsoft/SandDance / updateForwardRef

Function updateForwardRef

docs/external/js/react-dom.development.js:16925–16972  ·  view source on GitHub ↗
(current, workInProgress, Component, nextProps, renderExpirationTime)

Source from the content-addressed store, hash-verified

16923 }
16924
16925 function updateForwardRef(current, workInProgress, Component, nextProps, renderExpirationTime) {
16926 // TODO: current can be non-null here even if the component
16927 // hasn't yet mounted. This happens after the first render suspends.
16928 // We'll need to figure out if this is fine or can cause issues.
16929 {
16930 if (workInProgress.type !== workInProgress.elementType) {
16931 // Lazy component props can't be validated in createElement
16932 // because they're only guaranteed to be resolved here.
16933 var innerPropTypes = Component.propTypes;
16934
16935 if (innerPropTypes) {
16936 checkPropTypes_1(innerPropTypes, nextProps, // Resolved props
16937 'prop', getComponentName(Component), getCurrentFiberStackInDev);
16938 }
16939 }
16940 }
16941
16942 var render = Component.render;
16943 var ref = workInProgress.ref; // The rest is a fork of updateFunctionComponent
16944
16945 var nextChildren;
16946 prepareToReadContext(workInProgress, renderExpirationTime);
16947
16948 {
16949 ReactCurrentOwner$1.current = workInProgress;
16950 setIsRendering(true);
16951 nextChildren = renderWithHooks(current, workInProgress, render, nextProps, ref, renderExpirationTime);
16952
16953 if ( workInProgress.mode & StrictMode) {
16954 // Only double-render components with Hooks
16955 if (workInProgress.memoizedState !== null) {
16956 nextChildren = renderWithHooks(current, workInProgress, render, nextProps, ref, renderExpirationTime);
16957 }
16958 }
16959
16960 setIsRendering(false);
16961 }
16962
16963 if (current !== null && !didReceiveUpdate) {
16964 bailoutHooks(current, workInProgress, renderExpirationTime);
16965 return bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime);
16966 } // React DevTools reads this flag.
16967
16968
16969 workInProgress.effectTag |= PerformedWork;
16970 reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime);
16971 return workInProgress.child;
16972 }
16973
16974 function updateMemoComponent(current, workInProgress, Component, nextProps, updateExpirationTime, renderExpirationTime) {
16975 if (current === null) {

Callers 2

mountLazyComponentFunction · 0.85
beginWorkFunction · 0.85

Calls 7

prepareToReadContextFunction · 0.85
setIsRenderingFunction · 0.85
renderWithHooksFunction · 0.85
bailoutHooksFunction · 0.85
reconcileChildrenFunction · 0.85
getComponentNameFunction · 0.70

Tested by

no test coverage detected