Files
react-native/scripts
Alex Hunt ef6463c25d Align nullable types across Appearance API (#56687)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56687

Simplify and align nullable values in the `Appearance` API.

| API | Flow / Strict TS API | Manual `.d.ts` |
|---|---|---|
| `getColorScheme()` | `ColorSchemeName | null` (narrowed) | `ColorSchemeName | null` |
| `useColorScheme()` | `ColorSchemeName | null` (narrowed) | `ColorSchemeName | null` (fixed) |

At the native spec level, nullability is removed entirely — the module always returns a valid color scheme, and the module-level `?Spec` already covers the "module absent" case.

Changelog:
[General][Breaking] - Fix return type of `useColorScheme()` hook (now  `ColorSchemeName | null`)
- Release Crew note: This is a net fix/extension of D102527387

Reviewed By: cipolleschi

Differential Revision: D103865622

fbshipit-source-id: a6391cfd86a634ea660734735614169d0601a830
2026-05-07 01:54:35 -07:00
..