Commit 08d1764
fix: color scheme in appearance state after setting it to unspecified (#54993)
Summary:
Fixed the value of the color scheme in the appearance state after setting it to unspecified when state updates. The issue is described here #54959. This is a regression from #53397 and should be reproducible from 0.82 and higher. The `useColorScheme()` hook will return "unspecified" when you change the appearance from system color (dark or light) to system which breaks many apps using the value to determine whether to use dark/light mode colors.
## Changelog:
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[GENERAL] [FIXED] - Fix color scheme in appearance state after setting it to unspecified
Pull Request resolved: #54993
Test Plan:
1. Run the reproducer app in the issue - use dark mode when launching the app, press "change to dark" and then "change to system". The hook will return "unspecified" although the correct behavior should be dark.
2. Apply the changes in this PR.
3. The correct behavior should be seen.
Reviewed By: cipolleschi
Differential Revision: D92391594
Pulled By: cortinico
fbshipit-source-id: 3c0c471069f2eb4681bd53abf67957bcaa04e7b41 parent d494510 commit 08d1764
1 file changed
+6
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
103 | 108 | | |
104 | 109 | | |
105 | 110 | | |
| |||
0 commit comments