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:
Nick Gerleman
2023-02-09 00:54:42 -08:00
committed by Facebook GitHub Bot
parent 7c82a3fa11
commit 6d1667cf86
8 changed files with 0 additions and 63 deletions
-10
View File
@@ -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.
*/
-11
View File
@@ -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.
*/
-1
View File
@@ -26,7 +26,6 @@ export interface Spec extends TurboModule {
// types.
/* 'light' | 'dark' */
+getColorScheme: () => ?string;
+setColorScheme?: (colorScheme: string) => void;
// RCTEventEmitter
+addListener: (eventName: string) => void;