Skip to content

Commit

Permalink
[Fabric] Add flex: 1 to Offscreen view container (facebook#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 and zhengjitf committed Apr 15, 2022
1 parent 476e7bc commit b8c9fe4
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 b8c9fe4

Please sign in to comment.