Description
- I used Nesting navigators like this
root stack nav -> stack nav -> bottom tab -> stack nav (last stack screen)
- Header style (backgroundColor) in my header in last stack screen doesn’t work
- Have some screen work but some screen don’t work.
- when close app and reopen app then sometime it work fine (yellow header) but sometime it doesn’t work(transparent header).
Screenshots
Steps To Reproduce
import { createNativeStackNavigator } from "react-native-screens/native-stack"
const Stack = createNativeStackNavigator<PrimaryMoreParamList>()
const HeaderCenter = (props: any) => {
const { tx, text, ...rest } = props
const textProps = tx ? { tx } : { text }
return (<Text {...textProps} {...rest} preset="topic" />)
}
export function MoreNavigator() {
return (
<Stack.Navigator
screenOptions={{
headerShown: true,
gestureEnabled: true,
headerStyle: {
backgroundColor: 'yellow', // It should be yellow color
},
stackAnimation: 'slide_from_right',
}}
>
<Stack.Screen name="more" component={MoreScreen}
options={({ navigation, route }) => ({
headerCenter: () => <HeaderCenter tx={"moreScreen.moreMenu"} />,
headerHideShadow: false,
})}
/>
</Stack.Navigator>
)
}
After a clean build on simulator with the patch, I think the bug should be fixed now (at least we haven’t had the same problem yet), now sure why it didn’t work yesterday 🤔️
Anyway, thanks for your help ❤️
Can you provide a code example with minimal configuration needed to reproduce the issue then?