From 7addf44d683d0bb8b74d17dee276878084772612 Mon Sep 17 00:00:00 2001 From: Andrew Clark Date: Fri, 30 Jul 2021 15:18:41 -0400 Subject: [PATCH] Fix: Use getOffscreenContainerProps The type of these props is different per renderer. An oversight from #21960. Unfortunately wasn't caught by Flow because fiber props are `any`-typed. --- packages/react-reconciler/src/ReactFiberBeginWork.new.js | 6 +++--- packages/react-reconciler/src/ReactFiberBeginWork.old.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/react-reconciler/src/ReactFiberBeginWork.new.js b/packages/react-reconciler/src/ReactFiberBeginWork.new.js index dd8ccc025cf4e..1a248de5a9a0c 100644 --- a/packages/react-reconciler/src/ReactFiberBeginWork.new.js +++ b/packages/react-reconciler/src/ReactFiberBeginWork.new.js @@ -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( diff --git a/packages/react-reconciler/src/ReactFiberBeginWork.old.js b/packages/react-reconciler/src/ReactFiberBeginWork.old.js index bae769b1ce7d3..10129f9efb986 100644 --- a/packages/react-reconciler/src/ReactFiberBeginWork.old.js +++ b/packages/react-reconciler/src/ReactFiberBeginWork.old.js @@ -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(