Appreance.getColorScheme() always returns "light" | Android | IOS | React Native | Expo #44522
Labels
Needs: Triage 🔍
Newer Patch Available
Platform: Android
Android applications.
Platform: iOS
iOS applications.
Description
Whenever using Expo to build React Native apps, Apperance.getColorScheme always returns "Light". It is not a React Native bug rather a Expo bugs. I search for a solution for days but couldn't find one. Ever had a same issue of github titled same but no good answer.
Finally I got the fix and I want to share it with the community "Note: make sure your iOs or Android project is not hard-coded to a light user-interface style, or the above will not work. If using Expo, you will need to set "userInterfaceStyle": "automatic" in your app.json under the expo key (the default is “light”)."
Steps to reproduce
"expo": {
"name": "FirstRNApp",
"slug": "FirstRNApp",
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
"userInterfaceStyle": "light",
"splash": {
"image": "./assets/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
React Native Version
0.73.6
Affected Platforms
Other (please specify)
Output of
npx react-native info
Stacktrace or Logs
Reproducer
https://github.com/AbdullahSherMuhammad/FocusApp-ReactNative
Screenshots and Videos
No response
The text was updated successfully, but these errors were encountered: