Appearence. addChangeListener does not reacts to changes of the themes change on OS after Appearance.setColorScheme was used and reacts only to Appearance.setColorScheme
Description
Issue Summary: After The Appearance.addChangeListener method does not respond to changes in the operating system's theme settings after the Appearance.setColorScheme method has been invoked within the application. It seems that manually setting a color scheme causes the listener to ignore subsequent OS theme changes, thereby not triggering the expected callbacks when the OS theme is altered. Expected Behavior: The listener set up through Appearance.addChangeListener should react to changes in the OS theme, even after manually setting the application's theme using Appearance.setColorScheme. It is expected to trigger the appropriate callbacks, allowing the application to adapt to the OS theme changes dynamically.
Steps to reproduce
- Start the application with the Appearance.addChangeListener already set up to listen for theme changes.
- Manually change the application theme using Appearance.setColorScheme('dark') or Appearance.setColorScheme('light').
- Change the operating system's theme (e.g., from light to dark mode or vice versa).
- Observe that the change listener does not trigger a callback in response to the OS theme change.
React Native Version
0.72.4
Affected Platforms
Runtime - iOS
Output of npx react-native info
System:
OS: macOS 14.4
CPU: (10) arm64 Apple M1 Pro
Memory: 98.70 MB / 16.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 16.20.2
path: ~/.nvm/versions/node/v16.20.2/bin/node
Yarn: Not Found
npm:
version: 8.19.4
path: ~/.nvm/versions/node/v16.20.2/bin/npm
Watchman: Not Found
Managers:
CocoaPods:
version: 1.12.1
path: /Users/oleksandrromanovskij/.rbenv/shims/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 23.4
- iOS 17.4
- macOS 14.4
- tvOS 17.4
- visionOS 1.1
- watchOS 10.4
Android SDK:
API Levels:
- "28"
- "29"
- "30"
- "31"
- "33"
- "34"
Build Tools:
- 28.0.3
- 29.0.2
- 30.0.2
- 30.0.3
- 33.0.0
System Images:
- android-29 | Intel x86 Atom_64
- android-30 | Google APIs ARM 64 v8a
- android-30 | Google APIs Intel x86 Atom
- android-30 | Google Play Intel x86 Atom
- android-31 | Google APIs ARM 64 v8a
- android-31 | Google Play ARM 64 v8a
Android NDK: Not Found
IDEs:
Android Studio: 2021.1 AI-211.7628.21.2111.8309675
Xcode:
version: 15.3/15E204a
path: /usr/bin/xcodebuild
Languages:
Java:
version: 11.0.19
path: /usr/bin/javac
Ruby:
version: 2.6.10
path: /Users/oleksandrromanovskij/.rbenv/shims/ruby
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.72.4
wanted: 0.72.4
react-native-macos: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: true
newArchEnabled: false
iOS:
hermesEnabled: true
newArchEnabled: false
Stacktrace or Logs
No crash but incorrect work
Reproducer
its not
Screenshots and Videos
No response
| :warning: | Missing Reproducible Example |
|---|---|
| :information_source: | We could not detect a reproducible example in your issue report. Please provide either:
|
| :warning: | Newer Version of React Native is Available! |
|---|---|
| :information_source: | You are on a supported minor version, but it looks like there's a newer patch available - 0.72.12. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases. |
This issue is waiting for author's feedback since 24 days. Please provide the requested feedback or this will be closed in 7 days.
This issue is waiting for author's feedback since 24 days. Please provide the requested feedback or this will be closed in 7 days.
This issue was closed because it has been stalled for 7 days with no activity.
This issue was closed because the author hasn't provided the requested feedback after 7 days.