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

Function updateFunctionComponent

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

Source from the content-addressed store, hash-verified

17140 }
17141
17142 function updateFunctionComponent(current, workInProgress, Component, nextProps, renderExpirationTime) {
17143 {
17144 if (workInProgress.type !== workInProgress.elementType) {
17145 // Lazy component props can't be validated in createElement
17146 // because they're only guaranteed to be resolved here.
17147 var innerPropTypes = Component.propTypes;
17148
17149 if (innerPropTypes) {
17150 checkPropTypes_1(innerPropTypes, nextProps, // Resolved props
17151 'prop', getComponentName(Component), getCurrentFiberStackInDev);
17152 }
17153 }
17154 }
17155
17156 var context;
17157
17158 {
17159 var unmaskedContext = getUnmaskedContext(workInProgress, Component, true);
17160 context = getMaskedContext(workInProgress, unmaskedContext);
17161 }
17162
17163 var nextChildren;
17164 prepareToReadContext(workInProgress, renderExpirationTime);
17165
17166 {
17167 ReactCurrentOwner$1.current = workInProgress;
17168 setIsRendering(true);
17169 nextChildren = renderWithHooks(current, workInProgress, Component, nextProps, context, renderExpirationTime);
17170
17171 if ( workInProgress.mode & StrictMode) {
17172 // Only double-render components with Hooks
17173 if (workInProgress.memoizedState !== null) {
17174 nextChildren = renderWithHooks(current, workInProgress, Component, nextProps, context, renderExpirationTime);
17175 }
17176 }
17177
17178 setIsRendering(false);
17179 }
17180
17181 if (current !== null && !didReceiveUpdate) {
17182 bailoutHooks(current, workInProgress, renderExpirationTime);
17183 return bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime);
17184 } // React DevTools reads this flag.
17185
17186
17187 workInProgress.effectTag |= PerformedWork;
17188 reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime);
17189 return workInProgress.child;
17190 }
17191
17192 function updateClassComponent(current, workInProgress, Component, nextProps, renderExpirationTime) {
17193 {

Callers 3

mountLazyComponentFunction · 0.85
beginWorkFunction · 0.85

Calls 9

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

Tested by

no test coverage detected