Skip to content

Commit 215db46

Browse files
authored
[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.
1 parent 8a37b0e commit 215db46

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/react-native-renderer/src/ReactFabricHostConfig.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,9 @@ export function getOffscreenContainerProps(
453453
} else {
454454
return {
455455
children,
456+
style: {
457+
flex: 1,
458+
},
456459
};
457460
}
458461
}

0 commit comments

Comments
 (0)