Apparence turns light (for an instant) to when back and forth on iOS with SDK39
See original GitHub issueHi guys,
For some reason the useColorScheme
on iOS returns “light” (for a moment) when the application goes to background and returns to foreground, I suppose that this is something that the SDK39 introduces because I had no problem with the previous version.
It could be that it is related to a facebook issue:
https://github.com/facebook/react-native/issues/28525
here I leave an video of the problem:
Alternatively I tried with the native useColorTheme
and had the same unwanted effect.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:11
- Comments:32 (10 by maintainers)
Top Results From Across the Web
Supporting Dark Mode in Your Interface - Apple Developer
In macOS and iOS, users can choose to adopt a system-wide light or dark appearance. The dark appearance, known as Dark Mode, implements...
Read more >Light and dark modes - Expo Documentation
Learn how to support light and dark modes in your app.
Read more >Implement dark mode switch in SwiftUI App - Stack Overflow
preferredColorScheme(isDarkMode ? .dark : .light) // tint on status ... once the app switches state (goes to the background and comes back).
Read more >Dark mode - QuickBooks Design System
It analyzes your Figma file, converts colors for you, and can go back and forth between dark mode and light mode.
Read more >How to automatically change between dark mode and light ...
This is how to set your iPhone to automatically change appearance between dark mode and light mode using shortcut automations on iOS 15!...
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 Free
Top 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
great @jasonaibrahim, i made few tweak usign lodash and better memoization to reduce size, at this moment the only way i know to “workaround” this issue is throttled the
Appearance
updates 😞BTW, 250ms on throttle invocations works for me
if anyone needs a workaround while this is sorted out, here it is as a hook that can be used in lieu of the rn
useColorScheme
hook. it throttles the color scheme change events so that the more recent one is used as thecolorScheme
value, since the first event seems to be incorrect but subsequent values are correct