MCPcopy Index your code
hub / github.com/caseywebdev/react-list / beginWork

Function beginWork

docs/index.js:10092–10571  ·  view source on GitHub ↗
(current, workInProgress, renderLanes)

Source from the content-addressed store, hash-verified

10090 return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);
10091}
10092function beginWork(current, workInProgress, renderLanes) {
10093 if (null !== current)
10094 if (current.memoizedProps !== workInProgress.pendingProps)
10095 didReceiveUpdate = !0;
10096 else {
10097 if (
10098 !checkScheduledUpdateOrContext(current, renderLanes) &&
10099 0 === (workInProgress.flags & 128)
10100 )
10101 return (
10102 (didReceiveUpdate = !1),
10103 attemptEarlyBailoutIfNoScheduledUpdate(
10104 current,
10105 workInProgress,
10106 renderLanes
10107 )
10108 );
10109 didReceiveUpdate = 0 !== (current.flags & 131072) ? !0 : !1;
10110 }
10111 else
10112 (didReceiveUpdate = !1),
10113 isHydrating &&
10114 0 !== (workInProgress.flags & 1048576) &&
10115 pushTreeId(workInProgress, treeForkCount, workInProgress.index);
10116 workInProgress.lanes = 0;
10117 switch (workInProgress.tag) {
10118 case 16:
10119 a: {
10120 current = workInProgress.pendingProps;
10121 var lazyComponent = workInProgress.elementType,
10122 init = lazyComponent._init;
10123 lazyComponent = init(lazyComponent._payload);
10124 workInProgress.type = lazyComponent;
10125 if ("function" === typeof lazyComponent)
10126 shouldConstruct(lazyComponent)
10127 ? ((current = resolveClassComponentProps(lazyComponent, current)),
10128 (workInProgress.tag = 1),
10129 (workInProgress = updateClassComponent(
10130 null,
10131 workInProgress,
10132 lazyComponent,
10133 current,
10134 renderLanes
10135 )))
10136 : ((workInProgress.tag = 0),
10137 (workInProgress = updateFunctionComponent(
10138 null,
10139 workInProgress,
10140 lazyComponent,
10141 current,
10142 renderLanes
10143 )));
10144 else {
10145 if (void 0 !== lazyComponent && null !== lazyComponent)
10146 if (
10147 ((init = lazyComponent.$$typeof), init === REACT_FORWARD_REF_TYPE)
10148 ) {
10149 workInProgress.tag = 11;

Callers 3

performUnitOfWorkFunction · 0.85
replayBeginWorkFunction · 0.85

Calls 15

pushTreeIdFunction · 0.85
shouldConstructFunction · 0.85
updateClassComponentFunction · 0.85
updateFunctionComponentFunction · 0.85
updateForwardRefFunction · 0.85
updateMemoComponentFunction · 0.85
getComponentNameFromTypeFunction · 0.85
formatProdErrorMessageFunction · 0.85
pushHostContainerFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…