React Native useColorScheme()
hook stops working when using presentation: 'fullScreenModal'
#2002
Labels
Platform: iOS
This issue is specific to iOS
Repro provided
A reproduction with a snack or repo is provided
Description
Current behavior
I am trying to present a Stack.Navigator as a fullScreenModal of a different stack, like so:
My app needs to support light and dark mode, which I am doing by utilizing React Native's useColorScheme() hook.
The rest of my app responds instantly to changes in the user's color scheme preference, but when a screen is in a fullScreenModal context, useColorScheme stops returning a correct value when the device color scheme changes.
Using formSheet works properly.
fullScreenModal:
https://github.com/react-navigation/react-navigation/assets/66689851/8931a780-3ae2-42ca-8ced-d968ae25cd23
formSheet:
https://github.com/react-navigation/react-navigation/assets/66689851/1d3740da-70a1-4b4b-9931-a01aa159beba
Expected behavior
I expect the UI to respond properly to the system color scheme when a screen is presented via a fullScreenModal.
Steps to reproduce
Snack or a link to a repository
https://snack.expo.dev/w8orUoZon
Note I'm getting an error in snack but you should be able to use this code to check on a real device, following the Steps above.
Screens version
3.20.0
React Native version
0.72.3
Platforms
iOS
JavaScript runtime
Hermes
Workflow
React Native (without Expo)
Architecture
None
Build type
Release mode
Device
Real device
Device model
IOS 17 iPhone 13 Pro
Acknowledgements
Yes
The text was updated successfully, but these errors were encountered: