Skip to content

Commit 0f4d71e

Browse files
authored
Merge branch 'main' into update_pressable_docs
2 parents e9f48fb + 0892fa6 commit 0f4d71e

679 files changed

Lines changed: 52925 additions & 3908 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/pre-merge.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
branches:
66
- main
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
lint:
1013
runs-on: ubuntu-latest
@@ -33,6 +36,29 @@ jobs:
3336
- name: Run plugins lint
3437
run: yarn lint:plugins
3538

39+
check-vercel-redirects:
40+
runs-on: ubuntu-latest
41+
steps:
42+
- name: Checkout repository
43+
uses: actions/checkout@v6
44+
45+
- name: Set up Node.js
46+
uses: actions/setup-node@v6
47+
with:
48+
node-version: "22"
49+
cache: yarn
50+
51+
- name: Install dependencies
52+
run: yarn install --immutable
53+
54+
- name: Check Vercel redirects are in sync
55+
run: |
56+
yarn sync-redirects:vercel
57+
if ! git diff --exit-code vercel.json; then
58+
echo "::error::vercel.json redirects are out of sync with _redirects. Run 'yarn sync-redirects:vercel' and commit."
59+
exit 1
60+
fi
61+
3662
lint-website:
3763
runs-on: ubuntu-latest
3864
steps:

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,5 @@ website/build/
3333
!.yarn/releases
3434
!.yarn/sdks
3535
!.yarn/versions
36+
.vercel
37+
.env*.local

docs/_canary-channel-api-warning.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
:::tip Canary 🧪
1+
:::tip[Canary 🧪]
22

33
**This API is currently only available in React Native’s Canary and Experimental channels.**
44

docs/_experimental-api-warning.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
:::important Experimental 🧪
1+
:::important[Experimental 🧪]
22

33
**This API is experimental.** Experimental APIs may contain bugs and are likely to change in a future version of React Native. Don't use them in production.
44

docs/_experimental-channel-api-warning.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
:::tip Experimental Feature 🧪
1+
:::important[Experimental Feature 🧪]
22

33
**This API is currently only available in React Native’s Experimental channels.**
44

docs/alertios.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ id: alertios
33
title: '❌ AlertIOS'
44
---
55

6-
:::danger Removed from React Native
6+
:::danger[Removed from React Native]
77
Use [`Alert`](alert) instead.
88
:::

docs/appearance.md

Lines changed: 36 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import con
99
import {Appearance} from 'react-native';
1010
```
1111

12-
The `Appearance` module exposes information about the user's appearance preferences, such as their preferred color scheme (light or dark).
12+
The `Appearance` module exposes information about the user's appearance preferences, such as their preferred system color scheme (light or dark).
1313

1414
#### Developer notes
1515

@@ -53,7 +53,26 @@ if (colorScheme === 'dark') {
5353
}
5454
```
5555

56-
Although the color scheme is available immediately, this may change (e.g. scheduled color scheme change at sunrise or sunset). Any rendering logic or styles that depend on the user preferred color scheme should try to call this function on every render, rather than caching the value. For example, you may use the [`useColorScheme`](usecolorscheme) React hook as it provides and subscribes to color scheme updates, or you may use inline styles rather than setting a value in a `StyleSheet`.
56+
Although the color scheme is available immediately, this may change when not overridden via `setColorScheme()` (e.g. scheduled color scheme change at sunrise or sunset). Any rendering logic or styles that depend on the user preferred color scheme should try to call this function on every render, rather than caching the value.
57+
58+
**Recommended:** Use the [`useColorScheme`](usecolorscheme) hook.
59+
60+
### App-level overriding
61+
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.
63+
64+
```mermaid
65+
flowchart TD
66+
USC["useColorScheme()"] --> GCS["getColorScheme()"]
67+
GCS --> DEC{App override?}
68+
DEC -- "NO / reset via setColorScheme('auto')" --> SYS["System preference\n'light' or 'dark'"]
69+
DEC -- "YES — setColorScheme('light' | 'dark')" --> OVR["'light' or 'dark' (static)"]
70+
71+
classDef fn fill:#dce8f8,stroke:#4a90d9,color:#1a1a1a
72+
classDef out fill:#f0f4f8,stroke:#8faabb,color:#1a1a1a
73+
class USC,GCS fn
74+
class OVR,SYS out
75+
```
5776

5877
---
5978

@@ -67,39 +86,34 @@ Although the color scheme is available immediately, this may change (e.g. schedu
6786
static getColorScheme(): 'light' | 'dark' | null;
6887
```
6988

70-
Indicates the current user preferred color scheme. The value may be updated later, either through direct user action (e.g. theme selection in device settings or application-level selected user interface style via `setColorScheme`) or on a schedule (e.g. light and dark themes that follow the day/night cycle).
89+
Returns the active color scheme. This value may change at runtime, either at the system level (e.g. scheduled color scheme change at sunrise or sunset) or when overridden at the app level via `setColorScheme()`.
7190

72-
Supported color schemes:
91+
Return values:
7392

74-
- `'light'`: The user prefers a light color theme.
75-
- `'dark'`: The user prefers a dark color theme.
76-
- `null`: The user has not indicated a preferred color theme.
93+
- `'light'`: The light color scheme is applied.
94+
- `'dark'`: The dark color scheme is applied.
95+
- `null`: May be returned if the native Appearance module is not available.
7796

78-
See also: `useColorScheme` hook.
79-
80-
:::note
81-
`getColorScheme()` will always return `light` when debugging with Chrome.
82-
:::
97+
See also: [`useColorScheme`](usecolorscheme) (hook).
8398

8499
---
85100

86101
### `setColorScheme()`
87102

88103
```tsx
89-
static setColorScheme('light' | 'dark' | null): void;
104+
static setColorScheme('light' | 'dark' | 'auto' | 'unspecified'): void;
90105
```
91106

92-
Force the application to always adopt a light or dark interface style. The default value is `null` which causes the application to inherit the system's interface style. If you assign a different value, the new style applies to the application and all native elements within the application (Alerts, Pickers etc).
107+
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.).
93108

94-
Supported color schemes:
109+
This is an app-level override — it does not affect the system's selected interface style or any style set in other applications.
95110

96-
- `light`: Apply light user interface style.
97-
- `dark`: Apply dark user interface style.
98-
- null: Follow the system's interface style.
111+
Supported values:
99112

100-
:::note
101-
The change will not affect the system's selected interface style or any style set in other applications.
102-
:::
113+
- `'light'`: Apply light color scheme.
114+
- `'dark'`: Apply dark color scheme.
115+
- `'auto'`: Follow the system color scheme (removes any override).
116+
- `'unspecified'` (**deprecated**): Follow the system color scheme (removes any override).
103117

104118
---
105119

@@ -111,4 +125,4 @@ static addChangeListener(
111125
): NativeEventSubscription;
112126
```
113127

114-
Add an event handler that is fired when appearance preferences change.
128+
Add an event handler that is fired when appearance preferences change. On iOS and Android, the `colorScheme` value in the callback is always `'light'` or `'dark'`.

docs/appstate.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ AppState is frequently used to determine the intent and proper behavior when han
1313
- `background` - The app is running in the background. The user is either:
1414
- in another app
1515
- on the home screen
16-
- [Android] on another `Activity` (even if it was launched by your app)
16+
- [Android] on another `Activity`, including temporary system activities such
17+
as autofill credential pickers (even if launched by your app or the system)
1718
- [iOS] `inactive` - This is a state that occurs when transitioning between foreground & background, and during periods of inactivity such as entering the multitasking view, opening the Notification Center or in the event of an incoming call.
1819

1920
For more information, see [Apple's documentation](https://developer.apple.com/documentation/uikit/app_and_scenes/managing_your_app_s_life_cycle)

docs/asyncstorage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ id: asyncstorage
33
title: '❌ AsyncStorage'
44
---
55

6-
:::danger Removed from React Native
6+
:::danger[Removed from React Native]
77
Use one of the [community packages](https://reactnative.directory/?search=storage) instead.
88
:::

docs/checkbox.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ id: checkbox
33
title: '❌ CheckBox'
44
---
55

6-
:::danger Removed from React Native
6+
:::danger[Removed from React Native]
77
Use one of the [community packages](https://reactnative.directory/?search=checkbox) instead.
88
:::

0 commit comments

Comments
 (0)