diff --git a/packages/react-reconciler/src/ReactChildFiber.js b/packages/react-reconciler/src/ReactChildFiber.js index f5203c7e0db39..7888d7a34a64a 100644 --- a/packages/react-reconciler/src/ReactChildFiber.js +++ b/packages/react-reconciler/src/ReactChildFiber.js @@ -325,14 +325,10 @@ function ChildReconciler(shouldTrackSideEffects) { return existingChildren; } - function useFiber( - fiber: Fiber, - pendingProps: mixed, - expirationTime: ExpirationTime, - ): Fiber { + function useFiber(fiber: Fiber, pendingProps: mixed): Fiber { // We currently set sibling to null and index to 0 here because it is easy // to forget to do before returning it. E.g. for the single child case. - const clone = createWorkInProgress(fiber, pendingProps, expirationTime); + const clone = createWorkInProgress(fiber, pendingProps); clone.index = 0; clone.sibling = null; return clone; @@ -392,7 +388,7 @@ function ChildReconciler(shouldTrackSideEffects) { return created; } else { // Update - const existing = useFiber(current, textContent, expirationTime); + const existing = useFiber(current, textContent); existing.return = returnFiber; return existing; } @@ -411,7 +407,7 @@ function ChildReconciler(shouldTrackSideEffects) { (__DEV__ ? isCompatibleFamilyForHotReloading(current, element) : false) ) { // Move based on index - const existing = useFiber(current, element.props, expirationTime); + const existing = useFiber(current, element.props); existing.ref = coerceRef(returnFiber, current, element); existing.return = returnFiber; if (__DEV__) { @@ -426,7 +422,7 @@ function ChildReconciler(shouldTrackSideEffects) { element.type.render === current.type.render ) { // Same as above but also update the .type field. - const existing = useFiber(current, element.props, expirationTime); + const existing = useFiber(current, element.props); existing.return = returnFiber; existing.type = element.type; if (__DEV__) { @@ -469,7 +465,7 @@ function ChildReconciler(shouldTrackSideEffects) { return created; } else { // Update - const existing = useFiber(current, portal.children || [], expirationTime); + const existing = useFiber(current, portal.children || []); existing.return = returnFiber; return existing; } @@ -494,7 +490,7 @@ function ChildReconciler(shouldTrackSideEffects) { return created; } else { // Update - const existing = useFiber(current, fragment, expirationTime); + const existing = useFiber(current, fragment); existing.return = returnFiber; return existing; } @@ -1137,7 +1133,7 @@ function ChildReconciler(shouldTrackSideEffects) { // We already have an existing node so let's just update it and delete // the rest. deleteRemainingChildren(returnFiber, currentFirstChild.sibling); - const existing = useFiber(currentFirstChild, textContent, expirationTime); + const existing = useFiber(currentFirstChild, textContent); existing.return = returnFiber; return existing; } @@ -1169,11 +1165,7 @@ function ChildReconciler(shouldTrackSideEffects) { case Fragment: { if (element.type === REACT_FRAGMENT_TYPE) { deleteRemainingChildren(returnFiber, child.sibling); - const existing = useFiber( - child, - element.props.children, - expirationTime, - ); + const existing = useFiber(child, element.props.children); existing.return = returnFiber; if (__DEV__) { existing._debugSource = element._source; @@ -1190,7 +1182,7 @@ function ChildReconciler(shouldTrackSideEffects) { element.type.render === child.type.render ) { deleteRemainingChildren(returnFiber, child.sibling); - const existing = useFiber(child, element.props, expirationTime); + const existing = useFiber(child, element.props); existing.type = element.type; existing.return = returnFiber; if (__DEV__) { @@ -1211,7 +1203,7 @@ function ChildReconciler(shouldTrackSideEffects) { : false) ) { deleteRemainingChildren(returnFiber, child.sibling); - const existing = useFiber(child, element.props, expirationTime); + const existing = useFiber(child, element.props); existing.ref = coerceRef(returnFiber, child, element); existing.return = returnFiber; if (__DEV__) { @@ -1271,11 +1263,7 @@ function ChildReconciler(shouldTrackSideEffects) { child.stateNode.implementation === portal.implementation ) { deleteRemainingChildren(returnFiber, child.sibling); - const existing = useFiber( - child, - portal.children || [], - expirationTime, - ); + const existing = useFiber(child, portal.children || []); existing.return = returnFiber; return existing; } else { @@ -1441,11 +1429,7 @@ export function cloneChildFibers( } let currentChild = workInProgress.child; - let newChild = createWorkInProgress( - currentChild, - currentChild.pendingProps, - currentChild.expirationTime, - ); + let newChild = createWorkInProgress(currentChild, currentChild.pendingProps); workInProgress.child = newChild; newChild.return = workInProgress; @@ -1454,7 +1438,6 @@ export function cloneChildFibers( newChild = newChild.sibling = createWorkInProgress( currentChild, currentChild.pendingProps, - currentChild.expirationTime, ); newChild.return = workInProgress; } diff --git a/packages/react-reconciler/src/ReactFiber.js b/packages/react-reconciler/src/ReactFiber.js index a51116219927f..67aabe830bdfb 100644 --- a/packages/react-reconciler/src/ReactFiber.js +++ b/packages/react-reconciler/src/ReactFiber.js @@ -401,11 +401,7 @@ export function resolveLazyComponentTag(Component: Function): WorkTag { } // This is used to create an alternate fiber to do work on. -export function createWorkInProgress( - current: Fiber, - pendingProps: any, - expirationTime: ExpirationTime, -): Fiber { +export function createWorkInProgress(current: Fiber, pendingProps: any): Fiber { let workInProgress = current.alternate; if (workInProgress === null) { // We use a double buffering pooling technique because we know that we'll diff --git a/packages/react-reconciler/src/ReactFiberBeginWork.js b/packages/react-reconciler/src/ReactFiberBeginWork.js index 75ec89d469522..ff990e5801a99 100644 --- a/packages/react-reconciler/src/ReactFiberBeginWork.js +++ b/packages/react-reconciler/src/ReactFiberBeginWork.js @@ -466,11 +466,7 @@ function updateMemoComponent( } // React DevTools reads this flag. workInProgress.effectTag |= PerformedWork; - let newChild = createWorkInProgress( - currentChild, - nextProps, - renderExpirationTime, - ); + let newChild = createWorkInProgress(currentChild, nextProps); newChild.ref = workInProgress.ref; newChild.return = workInProgress; workInProgress.child = newChild; @@ -831,12 +827,7 @@ function updateClassComponent( workInProgress.effectTag |= Placement; } // In the initial pass we might need to construct the instance. - constructClassInstance( - workInProgress, - Component, - nextProps, - renderExpirationTime, - ); + constructClassInstance(workInProgress, Component, nextProps); mountClassInstance( workInProgress, Component, @@ -1296,12 +1287,7 @@ function mountIncompleteClassComponent( } prepareToReadContext(workInProgress, renderExpirationTime); - constructClassInstance( - workInProgress, - Component, - nextProps, - renderExpirationTime, - ); + constructClassInstance(workInProgress, Component, nextProps); mountClassInstance( workInProgress, Component, @@ -1871,7 +1857,6 @@ function updateSuspenseComponent( const primaryChildFragment = createWorkInProgress( currentPrimaryChildFragment, currentPrimaryChildFragment.pendingProps, - NoWork, ); primaryChildFragment.return = workInProgress; @@ -1911,7 +1896,6 @@ function updateSuspenseComponent( const fallbackChildFragment = createWorkInProgress( currentFallbackChildFragment, nextFallbackChildren, - currentFallbackChildFragment.expirationTime, ); fallbackChildFragment.return = workInProgress; primaryChildFragment.sibling = fallbackChildFragment; diff --git a/packages/react-reconciler/src/ReactFiberClassComponent.js b/packages/react-reconciler/src/ReactFiberClassComponent.js index f4736d1d67f0a..ba49e62804ada 100644 --- a/packages/react-reconciler/src/ReactFiberClassComponent.js +++ b/packages/react-reconciler/src/ReactFiberClassComponent.js @@ -535,7 +535,6 @@ function constructClassInstance( workInProgress: Fiber, ctor: any, props: any, - renderExpirationTime: ExpirationTime, ): any { let isLegacyContextConsumer = false; let unmaskedContext = emptyContextObject; diff --git a/packages/react-reconciler/src/ReactFiberCommitWork.js b/packages/react-reconciler/src/ReactFiberCommitWork.js index ba682cc93f53c..73942936e9a4a 100644 --- a/packages/react-reconciler/src/ReactFiberCommitWork.js +++ b/packages/react-reconciler/src/ReactFiberCommitWork.js @@ -576,12 +576,7 @@ function commitLifeCycles( // We could update instance props and state here, // but instead we rely on them being set during last render. // TODO: revisit this when we implement resuming. - commitUpdateQueue( - finishedWork, - updateQueue, - instance, - committedExpirationTime, - ); + commitUpdateQueue(finishedWork, updateQueue, instance); } return; } @@ -599,12 +594,7 @@ function commitLifeCycles( break; } } - commitUpdateQueue( - finishedWork, - updateQueue, - instance, - committedExpirationTime, - ); + commitUpdateQueue(finishedWork, updateQueue, instance); } return; } diff --git a/packages/react-reconciler/src/ReactFiberWorkLoop.js b/packages/react-reconciler/src/ReactFiberWorkLoop.js index 31946efd199bd..1c03f8f50a412 100644 --- a/packages/react-reconciler/src/ReactFiberWorkLoop.js +++ b/packages/react-reconciler/src/ReactFiberWorkLoop.js @@ -1252,7 +1252,7 @@ function prepareFreshStack(root, expirationTime) { } } workInProgressRoot = root; - workInProgress = createWorkInProgress(root.current, null, expirationTime); + workInProgress = createWorkInProgress(root.current, null); renderExpirationTime = expirationTime; workInProgressRootExitStatus = RootIncomplete; workInProgressRootFatalError = null; diff --git a/packages/react-reconciler/src/ReactUpdateQueue.js b/packages/react-reconciler/src/ReactUpdateQueue.js index dba13e3cf2a38..479f92dac9bbd 100644 --- a/packages/react-reconciler/src/ReactUpdateQueue.js +++ b/packages/react-reconciler/src/ReactUpdateQueue.js @@ -528,7 +528,6 @@ export function commitUpdateQueue( finishedWork: Fiber, finishedQueue: UpdateQueue, instance: any, - renderExpirationTime: ExpirationTime, ): void { // Commit the effects const effects = finishedQueue.effects;