UPDATE: I've submitted a PR to the Expo project to add this in all templates.
Yesterday, I tweeted that I was struggling with getting useColorScheme
to work in my "minimal" Expo React Native app. I simply couldn't get the app to detect when the iOS appearance preference changed.
However, in another Expo app (tabs), the appearance detection worked perfectly. Despite tons of searches, I couldn't find a solution. I finally resorted to comparing the working Expo app against the other one line by line.
Finally, I discovered the difference in the app.json
files. For the tabs Expo template, the file has this property:
"userInterfaceStyle": "automatic",
Once I added that to my minimal Expo app, it started working just fine! Perhaps Expo should add this property automatically to all apps? After all, virtually everyone is going to want to use it. For those that don't have a different theme per appearance, having this detection happen automatically won't affect them at all.