Root userInterfaceStyle does not apply on Android in Expo Go
See original GitHub issueSummary
{
"expo": {
"userInterfaceStyle": "automatic",
}
}
this will not change the user interface style behavior to allow for both light and dark themes, instead you need to set it on the Android key
{
"expo": {
"userInterfaceStyle": "automatic",
"android": {
"userInterfaceStyle": "automatic"
}
}
}
The root key does work as expected on iOS
Managed or bare workflow? If you have ios/
or android/
directories in your project, the answer is bare!
managed
What platform(s) does this occur on?
Android
SDK Version (managed workflow only)
42
Environment
Expo CLI 4.7.2 environment info:
System:
OS: macOS 11.2.3
Shell: 5.8 - /bin/zsh
Binaries:
Node: 14.15.2 - ~/.nvm/versions/node/v14.15.2/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 6.14.13 - ~/.nvm/versions/node/v14.15.2/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.10.1 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4
Android SDK:
API Levels: 26, 28, 29, 30
Build Tools: 26.0.3, 28.0.3, 29.0.2, 29.0.3, 30.0.2, 30.0.3
System Images: android-26 | Google APIs Intel x86 Atom_64, android-29 | Google Play Intel x86 Atom, android-30 | Google APIs Intel x86 Atom
Android NDK: 21.0.6113669
IDEs:
Android Studio: 4.1 AI-201.8743.12.41.7042882
Xcode: 12.5/12E262 - /usr/bin/xcodebuild
npmPackages:
expo: ~42.0.0 => 42.0.0
react: 16.13.1 => 16.13.1
react-dom: 16.13.1 => 16.13.1
react-native: https://github.com/expo/react-native/archive/sdk-42.0.0.tar.gz => 0.63.2
react-native-web: ~0.13.12 => 0.13.18
npmGlobalPackages:
expo-cli: 4.7.2
Expo Workflow: managed
Reproducible demo or steps to reproduce from a blank project
https://github.com/brentvatne/schemes
Run the project on Android and toggle between light/dark themes, notice the text doesn’t update. Now add "userInterfaceStyle": "automatic"
under the "android"
key and reload the app (not just fast refresh, full reload) and notice it works as expected.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:6
- Comments:18 (6 by maintainers)
Top Results From Across the Web
React Native Expo. Android dark mode issue - Stack Overflow
I have found a solution for React Native without Expo: React native android dark mode issue but I cannot use it because I...
Read more >Light and dark modes - Expo Documentation
Light and dark modes. Learn how to support light and dark modes in your app. Regardless of whether you are personally on team...
Read more >React-native-appearance - npm.io
Access operating system appearance information on iOS, Android, and web. Currently supports detecting preferred color scheme (light/dark). Installation.
Read more >Vaibhav Gadekar on Twitter: "I have created spotify ui clone with ...
... from live api server with realtime songs using react native and expo ... Root userInterfaceStyle does not apply on Android in Expo...
Read more >invariant violation: "main" has not been registered. this can ...
The project loads on my android device and it was loading on my ios device but for ... If you're trying to use...
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 FreeTop 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
Top GitHub Comments
this fix will land in sdk 43
Always returns light on iPhone simulator and always returns dark on actual iPhone device.
app.json