Skip to content

Commit

Permalink
Fix suspense replaying forwardRefs (facebook#26385)
Browse files Browse the repository at this point in the history
  • Loading branch information
hansottowirtz committed Apr 2, 2023
1 parent 0ae3480 commit 9829d02
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/react-reconciler/src/ReactFiberWorkLoop.js
Original file line number Diff line number Diff line change
Expand Up @@ -2386,7 +2386,10 @@ function replaySuspendedUnitOfWork(unitOfWork: Fiber): void {
// TODO: Consider moving this switch statement into that module. Also,
// could maybe use this as an opportunity to say `use` doesn't work with
// `defaultProps` :)
const Component = unitOfWork.type;
const Component =
unitOfWork.tag === FunctionComponent
? unitOfWork.type
: unitOfWork.type.render;
const unresolvedProps = unitOfWork.pendingProps;
const resolvedProps =
unitOfWork.elementType === Component
Expand Down

0 comments on commit 9829d02

Please sign in to comment.