Skip to content

Commit

Permalink
[Fabric] Add flex: 1 to Offscreen view container (#22019)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
acdlite authored Aug 4, 2021
1 parent 8a37b0e commit 215db46
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/react-native-renderer/src/ReactFabricHostConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,9 @@ export function getOffscreenContainerProps(
} else {
return {
children,
style: {
flex: 1,
},
};
}
}
Expand Down

0 comments on commit 215db46

Please sign in to comment.