-
Notifications
You must be signed in to change notification settings - Fork 141
Description
Introduction
Currently, Appearance.addChangeListener listens to the change of the user preference for the current app. I propose another API Appearance.addSystemChangeListener, this will listen to the system setting change.
Details
This came to me as I tried to use react-native-ui-lib, which's dark mode support is finnicky (wix/react-native-ui-lib#2127) and, at the moment for proper support, you need to keep the current color scheme until the user restarts the app. To keep all UI elements themed accordingly you have to use Appearance.setColorScheme, but that causes Appearance.addChangeListener to not fire anymore on system color scheme change. I propose the above mentioned Appearance.addSystemChangeListener as a way to display a message to inform them that they have to restart the app to see the theme change.
Discussion points
- Is this already supported through other APIs?
- Should the API for listening to system color scheme changes be different than mentioned above?