one
one copied to clipboard
React Native color scheme not changing when system theme changes
trafficstars
I made sure to set expo.userInterfaceStyle = "automatic"
Note: I'm doing my testing on iOS 18.1 simulator, and both debug and release schemes seem to be broken.
- Clone the reproduction repo
npm i --forcenpm run prebuild:native- Set scheme to release, build, and install on iOS 18.1 simulator
- Launch the app. The color scheme should correctly read the system theme
- Put the app in the background, but don't close it
- Toggle the system theme
- Put the app back in the foreground and see if it changed with the system
- Repeat steps 6-8 a second time, as the theme seems to sometimes change one but not a second time
Note: I imagine 18.1 isn't the issue, but just wanted to mention that incase it's a factor.
Since @vxrn/color-scheme uses React Native useColorScheme under the hood, it also doesn't seem to work.
Is React Native useColorScheme broken?
@natew that's what it seems? It's working in Expo but not One. No idea how that's even possible