Skip to content

Fix Appearance color scheme overrides - #2857

Open
huytdps13400 wants to merge 1 commit into
necolas:masterfrom
huytdps13400:fix/2703-appearance-set-color-scheme
Open

Fix Appearance color scheme overrides#2857
huytdps13400 wants to merge 1 commit into
necolas:masterfrom
huytdps13400:fix/2703-appearance-set-color-scheme

Conversation

@huytdps13400

Copy link
Copy Markdown

Summary

  • implement Appearance.setColorScheme with light and dark overrides
  • restore the system preference with auto, deprecated unspecified, or null
  • notify listeners only when the effective color scheme changes, while suppressing system changes during an override
  • document the API and add regression coverage for overrides, resets, subscriptions, and listener removal during dispatch

Fixes #2703.

Verification

  • npm run test — 47 DOM suites / 715 tests passed; 3 Node suites / 6 tests passed
  • npm run build -w react-native-web — Flow, ESM, and CommonJS builds passed
  • Chromium runtime check in the Next.js examples app — lightdarkauto updated the subscribed value correctly; no console warnings or errors
  • git diff --check

@codesandbox-ci

Copy link
Copy Markdown

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 951bc72:

Sandbox Source
react-native-web-examples Configuration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Appearance.setColorScheme not workin in RN Web

1 participant