Skip to content

Commit

Permalink
Gate IncompleteFunctionComponent which only happens in legacy mode
Browse files Browse the repository at this point in the history
  • Loading branch information
sebmarkbage committed Apr 3, 2024
1 parent 16a1326 commit 2e729cc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions packages/react-reconciler/src/ReactFiberBeginWork.js
Original file line number Diff line number Diff line change
Expand Up @@ -4037,6 +4037,9 @@ function beginWork(
);
}
case IncompleteFunctionComponent: {
if (disableLegacyMode) {
break;
}
const Component = workInProgress.type;
const unresolvedProps = workInProgress.pendingProps;
const resolvedProps =
Expand Down
7 changes: 6 additions & 1 deletion packages/react-reconciler/src/ReactFiberCompleteWork.js
Original file line number Diff line number Diff line change
Expand Up @@ -950,10 +950,15 @@ function completeWork(
// for hydration.
popTreeContext(workInProgress);
switch (workInProgress.tag) {
case IncompleteFunctionComponent: {
if (disableLegacyMode) {
break;
}
// Fallthrough
}
case LazyComponent:
case SimpleMemoComponent:
case FunctionComponent:
case IncompleteFunctionComponent:
case ForwardRef:
case Fragment:
case Mode:
Expand Down
1 change: 1 addition & 0 deletions packages/react-reconciler/src/getComponentNameFromFiber.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import {
SimpleMemoComponent,
LazyComponent,
IncompleteClassComponent,
IncompleteFunctionComponent,
DehydratedFragment,
SuspenseListComponent,
ScopeComponent,
Expand Down

0 comments on commit 2e729cc

Please sign in to comment.