fix: content container in native web stack should fill parent (#9832)

`flex: 1` needs to be set on the `View` container sits between the `Screen` component and screen contents in `NativeStackView` otherwise content on tabs nested inside native stack will not be visible, along with other similar types of bugs.

Reproducible example: https://gist.github.com/brentvatne/273d34be0c937237eb353e4100c49949

Apply the fix from this diff to see it resolves the issue.
This commit is contained in:
Brent Vatne
2021-08-18 05:02:37 -07:00
committed by GitHub
parent bc19ee7616
commit ec0d113eb2

View File

@@ -138,7 +138,9 @@ export default function NativeStackView({ state, descriptors }: Props) {
{ display: isFocused ? 'flex' : 'none' },
]}
>
<View style={contentStyle}>{render()}</View>
<View style={[styles.contentContainer, contentStyle]}>
{render()}
</View>
</Screen>
);
})}
@@ -151,6 +153,9 @@ const styles = StyleSheet.create({
container: {
flex: 1,
},
contentContainer: {
flex: 1,
},
backImage: {
height: 24,
width: 24,