Skip to content

Commit 5d4c911

Browse files
authored
[docs] Update Appearance.setColorScheme keys (0.87) (facebook#5070)
1 parent bf74247 commit 5d4c911

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

docs/appearance.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,13 @@ Although the color scheme is available immediately, this may change when not ove
5959

6060
### App-level overriding
6161

62-
`setColorScheme()` overrides the color scheme at the application level — it does not affect the system setting or other applications. Passing `'unspecified'` removes any override, restoring the system preference.
62+
`setColorScheme()` overrides the color scheme at the application level — it does not affect the system setting or other applications. Passing `'auto'` removes any override, restoring the system preference.
6363

6464
```mermaid
6565
flowchart TD
6666
USC["useColorScheme()"] --> GCS["getColorScheme()"]
6767
GCS --> DEC{App override?}
68-
DEC -- "NO / reset via setColorScheme('unspecified')" --> SYS["System preference\n'light' or 'dark'"]
68+
DEC -- "NO / reset via setColorScheme('auto')" --> SYS["System preference\n'light' or 'dark'"]
6969
DEC -- "YES — setColorScheme('light' | 'dark')" --> OVR["'light' or 'dark' (static)"]
7070
7171
classDef fn fill:#dce8f8,stroke:#4a90d9,color:#1a1a1a
@@ -101,7 +101,7 @@ See also: [`useColorScheme`](usecolorscheme) (hook).
101101
### `setColorScheme()`
102102

103103
```tsx
104-
static setColorScheme('light' | 'dark' | 'unspecified'): void;
104+
static setColorScheme('light' | 'dark' | 'auto' | 'unspecified'): void;
105105
```
106106

107107
Forces the application to always adopt a light or dark interface style. The change applies to the application and all native elements within it (Alerts, Pickers, etc.).
@@ -112,7 +112,8 @@ Supported values:
112112

113113
- `'light'`: Apply light color scheme.
114114
- `'dark'`: Apply dark color scheme.
115-
- `'unspecified'`: Follow the system color scheme (removes any override).
115+
- `'auto'`: Follow the system color scheme (removes any override).
116+
- `'unspecified'` (**deprecated**): Follow the system color scheme (removes any override).
116117

117118
---
118119

0 commit comments

Comments
 (0)