Skip to content

Commit 2b57a9b

Browse files
authored
Merge branch 'main' into update_pressable_docs
2 parents cbcbe4b + 0892fa6 commit 2b57a9b

344 files changed

Lines changed: 50332 additions & 1614 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/_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/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/colors.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ React Native only supports lowercase color names. Uppercase color names are not
6868

6969
#### `transparent`
7070

71-
This is a shortcut for `rgba(0,0,0,0)`, same like in [CSS3](https://www.w3.org/TR/css-color-3/#transparent).
71+
This is a shortcut for `rgba(0,0,0,0)`, same as in [CSS3](https://www.w3.org/TR/css-color-3/#transparent).
7272

7373
#### Color keywords
7474

docs/modal.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ A ref setter that will be assigned an [element node](element-nodes) when mounted
198198
### `onRequestClose`
199199

200200
The `onRequestClose` callback is called when the user taps the hardware back button on Android or the menu button on Apple TV. Because of this required prop, be aware that `BackHandler` events will not be emitted as long as the modal is open.
201-
On iOS, this callback is called when a Modal is being dismissed using a drag gesture when `presentationStyle` is `pageSheet or formSheet`. When `allowSwipeDismissal` is enabled this callback will be called after dismissing the modal.
201+
On iOS, this callback is called when a Modal is being dismissed using a drag gesture when `presentationStyle` is `pageSheet` or `formSheet`. When `allowSwipeDismissal` is enabled this callback will be called after dismissing the modal.
202202

203203
| Type |
204204
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

docs/platform-specific-code.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ const Component = Platform.select({
7272
<Component />;
7373
```
7474

75-
### Detecting the Android version <div className="label android" title="This section is related to Android platform">Android</div>
75+
### Detecting the Android version <div className="label android">Android</div>
7676

7777
On Android, the `Platform` module can also be used to detect the version of the Android Platform in which the app is running:
7878

@@ -86,7 +86,7 @@ if (Platform.Version === 25) {
8686

8787
**Note**: `Version` is set to the Android API version not the Android OS version. To find a mapping please refer to [Android Version History](https://en.wikipedia.org/wiki/Android_version_history#Overview).
8888

89-
### Detecting the iOS version <div className="label ios" title="This section is related to iOS platform">iOS</div>
89+
### Detecting the iOS version <div className="label ios">iOS</div>
9090

9191
On iOS, the `Version` is a result of `-[UIDevice systemVersion]`, which is a string with the current version of the operating system. An example of the system version is "10.3". For example, to detect the major version number on iOS:
9292

docs/scrollview.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,16 @@ Tag used to log scroll performance on this scroll view. Will force momentum even
608608

609609
---
610610

611+
### `scrollsChildToFocus` <div className="label android">Android</div>
612+
613+
When `true`, the ScrollView automatically scrolls to bring a focused child into view. Set to `false` to disable this behavior and take manual control of scroll position when focus changes.
614+
615+
| Type | Default |
616+
| ---- | ------- |
617+
| bool | `true` |
618+
619+
---
620+
611621
### `scrollToOverflowEnabled` <div className="label ios">iOS</div>
612622

613623
When `true`, the scroll view can be programmatically scrolled beyond its content size.

0 commit comments

Comments
 (0)