Skip to content

Commit

Permalink
Fix: Use getOffscreenContainerProps
Browse files Browse the repository at this point in the history
The type of these props is different per renderer. An oversight
from facebook#21960. Unfortunately wasn't caught by Flow because fiber props
are `any`-typed.
  • Loading branch information
acdlite committed Jul 30, 2021
1 parent f87c6e1 commit 7addf44
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions packages/react-reconciler/src/ReactFiberBeginWork.new.js
Original file line number Diff line number Diff line change
Expand Up @@ -2376,10 +2376,10 @@ function updateSuspenseFallbackChildren(
const isHidden = true;
const currentOffscreenContainer = currentPrimaryChildFragment.child;
const offscreenContainer: Fiber = (primaryChildFragment.child: any);
const containerProps = {
hidden: isHidden,
const containerProps = getOffscreenContainerProps(
isHidden ? 'hidden' : 'visible',
primaryChildren,
};
);
offscreenContainer.pendingProps = containerProps;
offscreenContainer.memoizedProps = containerProps;
completeSuspendedOffscreenHostContainer(
Expand Down
6 changes: 3 additions & 3 deletions packages/react-reconciler/src/ReactFiberBeginWork.old.js
Original file line number Diff line number Diff line change
Expand Up @@ -2376,10 +2376,10 @@ function updateSuspenseFallbackChildren(
const isHidden = true;
const currentOffscreenContainer = currentPrimaryChildFragment.child;
const offscreenContainer: Fiber = (primaryChildFragment.child: any);
const containerProps = {
hidden: isHidden,
const containerProps = getOffscreenContainerProps(
isHidden ? 'hidden' : 'visible',
primaryChildren,
};
);
offscreenContainer.pendingProps = containerProps;
offscreenContainer.memoizedProps = containerProps;
completeSuspendedOffscreenHostContainer(
Expand Down

0 comments on commit 7addf44

Please sign in to comment.