headerStyle and headerLargeStyle backgroundColor are not applied after theme switching
See original GitHub issueDescription
Header styles are not applied after switching the theme within the application
Screenshots


Steps To Reproduce
- Add custom styles with two themes for react-native-screens header
- Toggle theme
headerLargeTitleStyle: {
color: EStyleSheet.value('$label01'),
},
headerLargeStyle: {
backgroundColor: EStyleSheet.value('$ui02'),
},
headerTitleStyle: Platform.select({
ios: {
color: EStyleSheet.value('$label01'),
},
android: {
fontWeight: '700',
color: EStyleSheet.value('$label01'),
},
}),
headerStyle: {
backgroundColor: EStyleSheet.value('$ui02'),
},
Expected behavior
headerStyle: { backgroundColor } and headerLargeStyle: { backgroundColor } equals `EStyleSheet.value(‘$ui02’) after theme switching
Actual behavior
headerStyle and headerLargeStyle backgroundColor have system colors (not defined in Stack)
Stack
options={{
headerLargeTitle: true,
headerLargeTitleStyle: {
color: EStyleSheet.value('$label01'),
},
headerLargeStyle: {
backgroundColor: EStyleSheet.value('$ui02'),
},
headerTitleStyle: Platform.select({
ios: {
color: EStyleSheet.value('$label01'),
},
android: {
fontWeight: '700',
color: EStyleSheet.value('$label01'),
},
}),
headerStyle: {
backgroundColor: EStyleSheet.value('$ui02'),
},
}}
component={HomeScreen}
/>
Package versions
- React: 16.13.1
- React Native: 0.63.4
- React Native Screens: 2.18.1
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:23 (4 by maintainers)
Top Results From Across the Web
ReactNavigationStack Header Style is not working only he ...
if anyone tries this so please help me, I am trying to change the border colour top and bottom in the header in...
Read more >Change navigationOptions/headerStyle(backgroundColor) on ...
Hi guys, I am setting header style in navigationOptions Then on onScroll of View I am setting params bgColor to new value but...
Read more >react-native-screens - Bountysource
headerStyle and headerLargeStyle backgroundColor are not applied after ... Header styles are not applied after switching the theme within the application ...
Read more >Transparent Header – Submenu background color STILL ...
Hi,. I have read the changelog of the astra theme and I just want to tell you so much: the background colors of...
Read more >Native Stack Navigator | React Navigation
This will have no effect on the first screen in the stack. ... and changes the background color to transparent unless specified in...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I double confirm that the issue was fixed in v3.1.0 by #847.
Reproduction by evarouss:
react-native-screens 3.0.0
https://user-images.githubusercontent.com/39658211/115518901-fa171200-a288-11eb-9949-b5936f9c3895.mov
react-native-screens 3.1.1
https://user-images.githubusercontent.com/39658211/115518945-069b6a80-a289-11eb-9a5e-39f0ec9862b0.mov
Reproduction by hugo-chq:
react-native-screens 3.0.0
https://user-images.githubusercontent.com/39658211/115516220-309f5d80-a286-11eb-8940-90115ce22386.mov
react-native-screens 3.1.1
https://user-images.githubusercontent.com/39658211/115516279-3dbc4c80-a286-11eb-974b-059e42b46c08.mov
Here’s a scenario to reproduce the issue: In a nutshell, it’s a scenario where you have a native stack navigator inside of a tab navigator and custom screen options. The issue happens intermittently.
Issue:
Notice how the header is getting a dark background / losing the Theme Styles
Versions: