From 215db465a228955cfbb9d51cc68ed9390bfc353a Mon Sep 17 00:00:00 2001 From: Andrew Clark Date: Tue, 3 Aug 2021 22:26:49 -0400 Subject: [PATCH] [Fabric] Add `flex: 1` to Offscreen view container (#22019) Without this style property, the layout of the children is messed up. The goal is for the container view to have no layout at all. It should be a completely transparent wrapper, except for when we set `display: none` to hide its contents. On the web, the equivalent (at least in the spec) is `display: contents`. After some initial testing, this seems to be close enough to the desired behavior that we can ship it. We'll try rolling it out behind a flag. --- packages/react-native-renderer/src/ReactFabricHostConfig.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/react-native-renderer/src/ReactFabricHostConfig.js b/packages/react-native-renderer/src/ReactFabricHostConfig.js index ac7fb64d922cd..db9e5039f5373 100644 --- a/packages/react-native-renderer/src/ReactFabricHostConfig.js +++ b/packages/react-native-renderer/src/ReactFabricHostConfig.js @@ -453,6 +453,9 @@ export function getOffscreenContainerProps( } else { return { children, + style: { + flex: 1, + }, }; } }