mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-01-12 22:51:18 +08:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user