Skip to content

Commit 9dca7e9

Browse files
Merge branch 'main' into patch-1
2 parents 7792a6d + affe2f7 commit 9dca7e9

879 files changed

Lines changed: 115012 additions & 24272 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: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,24 @@ on:
55
branches:
66
- main
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
lint:
1013
runs-on: ubuntu-latest
1114
steps:
1215
- name: Checkout repository
1316
uses: actions/checkout@v6
1417

15-
- name: Enable Corepack
16-
run: corepack enable
17-
1818
- name: Set up Node.js
1919
uses: actions/setup-node@v6
2020
with:
2121
node-version: "22"
2222
cache: yarn
2323

2424
- name: Check lock for duplications
25-
run: yarn dedupe --check
25+
run: yarn update-lock --fail
2626

2727
- name: Install dependencies
2828
run: yarn install --immutable
@@ -36,14 +36,34 @@ jobs:
3636
- name: Run plugins lint
3737
run: yarn lint:plugins
3838

39-
lint-website:
39+
check-vercel-redirects:
4040
runs-on: ubuntu-latest
4141
steps:
4242
- name: Checkout repository
4343
uses: actions/checkout@v6
4444

45-
- name: Enable Corepack
46-
run: corepack enable
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+
62+
lint-website:
63+
runs-on: ubuntu-latest
64+
steps:
65+
- name: Checkout repository
66+
uses: actions/checkout@v6
4767

4868
- name: Set up Node.js
4969
uses: actions/setup-node@v6
@@ -64,9 +84,6 @@ jobs:
6484
- name: Checkout repository
6585
uses: actions/checkout@v6
6686

67-
- name: Enable Corepack
68-
run: corepack enable
69-
7087
- name: Set up Node.js
7188
uses: actions/setup-node@v6
7289
with:

.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

.yarnrc.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.

README.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,13 @@ This repo contains the website configuration and documentation powering the [Rea
1818

1919
1. [Git](https://git-scm.com/downloads).
2020
1. [Node](https://nodejs.org/en/download/) _(version 22 or greater)_.
21-
1. [Yarn](https://yarnpkg.com/getting-started/install) _(version 4)_.
21+
1. [Yarn Classic](https://classic.yarnpkg.com/en/docs/install) _(version 1)_.
2222
1. A fork and clone of the `react-native-website` repo _(for any contributions)_.
2323

2424
### Installation
2525

2626
1. `cd react-native-website` to go into the project root.
27-
1. Run `corepack enable` to enable Corepack.
28-
29-
> If the command above fails, run `npm install -g corepack@latest` to install the latest version of [Corepack](https://yarnpkg.com/corepack#installation).
30-
3127
1. Run `yarn` to install the website's workspace dependencies.
32-
> If you want to retain the globally installed `yarn` classic, you can use `corepack yarn` instead.
3328

3429
### Running locally
3530

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)

0 commit comments

Comments
 (0)