one icon indicating copy to clipboard operation
one copied to clipboard

React Native color scheme not changing when system theme changes

Open christianjuth opened this issue 10 months ago • 2 comments
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.

  1. Clone the reproduction repo
  2. npm i --force
  3. npm run prebuild:native
  4. Set scheme to release, build, and install on iOS 18.1 simulator
  5. Launch the app. The color scheme should correctly read the system theme
  6. Put the app in the background, but don't close it
  7. Toggle the system theme
  8. Put the app back in the foreground and see if it changed with the system
  9. 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.

christianjuth avatar Jan 25 '25 21:01 christianjuth

Is React Native useColorScheme broken?

natew avatar Jan 31 '25 19:01 natew

@natew that's what it seems? It's working in Expo but not One. No idea how that's even possible

christianjuth avatar Feb 01 '25 06:02 christianjuth