From 82a612d1faa1807fd331cf7c69a0150a2d4a3259 Mon Sep 17 00:00:00 2001 From: Andrew Clark Date: Tue, 3 Aug 2021 22:01:25 -0400 Subject: [PATCH] [Fabric] Add `flex: 1` to Offscreen view container 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, + }, }; } }