MCPcopy Create free account
hub / github.com/plotly/dash / updateFunctionComponent

Function updateFunctionComponent

dash/deps/react-dom@18.3.1.js:19595–19661  ·  view source on GitHub ↗
(current, workInProgress, Component, nextProps, renderLanes)

Source from the content-addressed store, hash-verified

19593 }
19594
19595 function updateFunctionComponent(current, workInProgress, Component, nextProps, renderLanes) {
19596 {
19597 if (workInProgress.type !== workInProgress.elementType) {
19598 // Lazy component props can't be validated in createElement
19599 // because they're only guaranteed to be resolved here.
19600 var innerPropTypes = Component.propTypes;
19601
19602 if (innerPropTypes) {
19603 checkPropTypes(innerPropTypes, nextProps, // Resolved props
19604 'prop', getComponentNameFromType(Component));
19605 }
19606 }
19607 }
19608
19609 var context;
19610
19611 {
19612 var unmaskedContext = getUnmaskedContext(workInProgress, Component, true);
19613 context = getMaskedContext(workInProgress, unmaskedContext);
19614 }
19615
19616 var nextChildren;
19617 var hasId;
19618 prepareToReadContext(workInProgress, renderLanes);
19619
19620 {
19621 markComponentRenderStarted(workInProgress);
19622 }
19623
19624 {
19625 ReactCurrentOwner$1.current = workInProgress;
19626 setIsRendering(true);
19627 nextChildren = renderWithHooks(current, workInProgress, Component, nextProps, context, renderLanes);
19628 hasId = checkDidRenderIdHook();
19629
19630 if ( workInProgress.mode & StrictLegacyMode) {
19631 setIsStrictModeForDevtools(true);
19632
19633 try {
19634 nextChildren = renderWithHooks(current, workInProgress, Component, nextProps, context, renderLanes);
19635 hasId = checkDidRenderIdHook();
19636 } finally {
19637 setIsStrictModeForDevtools(false);
19638 }
19639 }
19640
19641 setIsRendering(false);
19642 }
19643
19644 {
19645 markComponentRenderStopped();
19646 }
19647
19648 if (current !== null && !didReceiveUpdate) {
19649 bailoutHooks(current, workInProgress, renderLanes);
19650 return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);
19651 }
19652

Callers 3

mountLazyComponentFunction · 0.70
beginWorkFunction · 0.70

Calls 15

checkPropTypesFunction · 0.70
getComponentNameFromTypeFunction · 0.70
getUnmaskedContextFunction · 0.70
getMaskedContextFunction · 0.70
prepareToReadContextFunction · 0.70
setIsRenderingFunction · 0.70
renderWithHooksFunction · 0.70
checkDidRenderIdHookFunction · 0.70
bailoutHooksFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…