Skip to content

Commit

Permalink
Update name and swap current check
Browse files Browse the repository at this point in the history
  • Loading branch information
rickhanlonii committed May 10, 2022
1 parent 0a21cd3 commit 1fc45f3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
14 changes: 7 additions & 7 deletions packages/react-reconciler/src/ReactFiberBeginWork.new.js
Original file line number Diff line number Diff line change
Expand Up @@ -1110,7 +1110,7 @@ function updateClassComponent(
const instance = workInProgress.stateNode;
let shouldUpdate;
if (instance === null) {
resetIndeterminatePlacementForLegacyMode(current, workInProgress);
resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress);

// In the initial pass we might need to construct the instance.
constructClassInstance(workInProgress, Component, nextProps);
Expand Down Expand Up @@ -1461,7 +1461,7 @@ function mountLazyComponent(
elementType,
renderLanes,
) {
resetIndeterminatePlacementForLegacyMode(_current, workInProgress);
resetSuspendedCurrentOnMountInLegacyMode(_current, workInProgress);

const props = workInProgress.pendingProps;
const lazyComponent: LazyComponentType<any, any> = elementType;
Expand Down Expand Up @@ -1571,7 +1571,7 @@ function mountIncompleteClassComponent(
nextProps,
renderLanes,
) {
resetIndeterminatePlacementForLegacyMode(_current, workInProgress);
resetSuspendedCurrentOnMountInLegacyMode(_current, workInProgress);

// Promote the fiber to a class and try rendering again.
workInProgress.tag = ClassComponent;
Expand Down Expand Up @@ -1609,7 +1609,7 @@ function mountIndeterminateComponent(
Component,
renderLanes,
) {
resetIndeterminatePlacementForLegacyMode(_current, workInProgress);
resetSuspendedCurrentOnMountInLegacyMode(_current, workInProgress);

const props = workInProgress.pendingProps;
let context;
Expand Down Expand Up @@ -3341,9 +3341,9 @@ export function checkIfWorkInProgressReceivedUpdate() {
return didReceiveUpdate;
}

function resetIndeterminatePlacementForLegacyMode(current, workInProgress) {
if ((workInProgress.mode & ConcurrentMode) === NoMode) {
if (current !== null) {
function resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress) {
if (current !== null) {
if ((workInProgress.mode & ConcurrentMode) === NoMode) {
// A lazy component only mounts if it suspended inside a non-
// concurrent tree, in an inconsistent state. We want to treat it like
// a new mount, even though an empty version of it already committed.
Expand Down
14 changes: 7 additions & 7 deletions packages/react-reconciler/src/ReactFiberBeginWork.old.js
Original file line number Diff line number Diff line change
Expand Up @@ -1110,7 +1110,7 @@ function updateClassComponent(
const instance = workInProgress.stateNode;
let shouldUpdate;
if (instance === null) {
resetIndeterminatePlacementForLegacyMode(current, workInProgress);
resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress);

// In the initial pass we might need to construct the instance.
constructClassInstance(workInProgress, Component, nextProps);
Expand Down Expand Up @@ -1461,7 +1461,7 @@ function mountLazyComponent(
elementType,
renderLanes,
) {
resetIndeterminatePlacementForLegacyMode(_current, workInProgress);
resetSuspendedCurrentOnMountInLegacyMode(_current, workInProgress);

const props = workInProgress.pendingProps;
const lazyComponent: LazyComponentType<any, any> = elementType;
Expand Down Expand Up @@ -1571,7 +1571,7 @@ function mountIncompleteClassComponent(
nextProps,
renderLanes,
) {
resetIndeterminatePlacementForLegacyMode(_current, workInProgress);
resetSuspendedCurrentOnMountInLegacyMode(_current, workInProgress);

// Promote the fiber to a class and try rendering again.
workInProgress.tag = ClassComponent;
Expand Down Expand Up @@ -1609,7 +1609,7 @@ function mountIndeterminateComponent(
Component,
renderLanes,
) {
resetIndeterminatePlacementForLegacyMode(_current, workInProgress);
resetSuspendedCurrentOnMountInLegacyMode(_current, workInProgress);

const props = workInProgress.pendingProps;
let context;
Expand Down Expand Up @@ -3341,9 +3341,9 @@ export function checkIfWorkInProgressReceivedUpdate() {
return didReceiveUpdate;
}

function resetIndeterminatePlacementForLegacyMode(current, workInProgress) {
if ((workInProgress.mode & ConcurrentMode) === NoMode) {
if (current !== null) {
function resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress) {
if (current !== null) {
if ((workInProgress.mode & ConcurrentMode) === NoMode) {
// A lazy component only mounts if it suspended inside a non-
// concurrent tree, in an inconsistent state. We want to treat it like
// a new mount, even though an empty version of it already committed.
Expand Down

0 comments on commit 1fc45f3

Please sign in to comment.