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

Function updateFunctionalComponent

code/redux/public/app.js:10076–10107  ·  view source on GitHub ↗
(current, workInProgress)

Source from the content-addressed store, hash-verified

10074 }
10075
10076 function updateFunctionalComponent(current, workInProgress) {
10077 var fn = workInProgress.type;
10078 var nextProps = workInProgress.pendingProps;
10079
10080 if (hasLegacyContextChanged()) {
10081 // Normally we can bail out on props equality but if context has changed
10082 // we don't do the bailout and we have to reuse existing props instead.
10083 } else {
10084 if (workInProgress.memoizedProps === nextProps) {
10085 return bailoutOnAlreadyFinishedWork(current, workInProgress);
10086 }
10087 // TODO: consider bringing fn.shouldComponentUpdate() back.
10088 // It used to be here.
10089 }
10090
10091 var unmaskedContext = getUnmaskedContext(workInProgress);
10092 var context = getMaskedContext(workInProgress, unmaskedContext);
10093
10094 var nextChildren = void 0;
10095
10096 {
10097 ReactCurrentOwner.current = workInProgress;
10098 ReactDebugCurrentFiber.setCurrentPhase('render');
10099 nextChildren = fn(nextProps, context);
10100 ReactDebugCurrentFiber.setCurrentPhase(null);
10101 }
10102 // React DevTools reads this flag.
10103 workInProgress.effectTag |= PerformedWork;
10104 reconcileChildren(current, workInProgress, nextChildren);
10105 memoizeProps(workInProgress, nextProps);
10106 return workInProgress.child;
10107 }
10108
10109 function updateClassComponent(current, workInProgress, renderExpirationTime) {
10110 // Push context providers early to prevent context stack mismatches.

Callers 1

beginWorkFunction · 0.70

Calls 5

getUnmaskedContextFunction · 0.70
getMaskedContextFunction · 0.70
reconcileChildrenFunction · 0.70
memoizePropsFunction · 0.70

Tested by

no test coverage detected