mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Back out "Add Appearance.setColorScheme support"
Summary: See https://github.com/facebook/react-native/pull/35989#discussion_r1101016329 Changelog: [General][Fixed] - Back out "Add Appearance.setColorScheme support" Reviewed By: jacdebug Differential Revision: D43148056 fbshipit-source-id: 823ab8276207f243b788ce7757839a3e95bdbe07
This commit is contained in:
committed by
Facebook GitHub Bot
parent
7c82a3fa11
commit
6d1667cf86
Vendored
-10
@@ -28,16 +28,6 @@ export namespace Appearance {
|
||||
*/
|
||||
export function getColorScheme(): ColorSchemeName;
|
||||
|
||||
/**
|
||||
* Set the color scheme preference. This is useful for overriding the default
|
||||
* color scheme preference for the app. Note that this will not change the
|
||||
* appearance of the system UI, only the appearance of the app.
|
||||
* Only available on iOS 13+ and Android 10+.
|
||||
*/
|
||||
export function setColorScheme(
|
||||
scheme: ColorSchemeName | null | undefined,
|
||||
): void;
|
||||
|
||||
/**
|
||||
* Add an event handler that is fired when appearance preferences change.
|
||||
*/
|
||||
|
||||
@@ -85,17 +85,6 @@ module.exports = {
|
||||
return nativeColorScheme;
|
||||
},
|
||||
|
||||
setColorScheme(colorScheme: ?ColorSchemeName): void {
|
||||
const nativeColorScheme = colorScheme == null ? 'unspecified' : colorScheme;
|
||||
|
||||
invariant(
|
||||
colorScheme === 'dark' || colorScheme === 'light' || colorScheme == null,
|
||||
"Unrecognized color scheme. Did you mean 'dark', 'light' or null?",
|
||||
);
|
||||
|
||||
NativeAppearance?.setColorScheme?.(nativeColorScheme);
|
||||
},
|
||||
|
||||
/**
|
||||
* Add an event handler that is fired when appearance preferences change.
|
||||
*/
|
||||
|
||||
@@ -26,7 +26,6 @@ export interface Spec extends TurboModule {
|
||||
// types.
|
||||
/* 'light' | 'dark' */
|
||||
+getColorScheme: () => ?string;
|
||||
+setColorScheme?: (colorScheme: string) => void;
|
||||
|
||||
// RCTEventEmitter
|
||||
+addListener: (eventName: string) => void;
|
||||
|
||||
Reference in New Issue
Block a user