Skip to content

Commit 9dfd849

Browse files
authored
Merge branch 'main' into esm-and-eslint-flat-config
2 parents 710da9e + d09358d commit 9dfd849

302 files changed

Lines changed: 2241 additions & 2416 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.

docs/_experimental-api-warning.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
:::important Experimental 🧪
2+
3+
**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.
4+
5+
:::

docs/_getting-started-linux-android.md

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ While you can use any editor of your choice to develop your app, you will need t
66

77
<h3>Node</h3>
88

9-
Follow the [installation instructions for your Linux distribution](https://nodejs.org/en/download/package-manager/) to install Node 18.18 or newer.
9+
Follow the [installation instructions for your Linux distribution](https://nodejs.org/en/download/package-manager/) to install Node 20.19.4 or newer.
1010

1111
<h3>Java Development Kit</h3>
1212

@@ -26,7 +26,9 @@ Setting up your development environment can be somewhat tedious if you're new to
2626

2727
Then, click "Next" to install all of these components.
2828

29-
> If the checkboxes are grayed out, you will have a chance to install these components later on.
29+
:::note
30+
If the checkboxes are grayed out, you will have a chance to install these components later on.
31+
:::
3032

3133
Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.
3234

@@ -36,7 +38,9 @@ Android Studio installs the latest Android SDK by default. Building a React Nati
3638

3739
To do that, open Android Studio, click on "Configure" button and select "SDK Manager".
3840

39-
> The SDK Manager can also be found within the Android Studio "Settings" dialog, under **Languages & Frameworks****Android SDK**.
41+
:::tip
42+
The SDK Manager can also be found within the Android Studio "Settings" dialog, under **Languages & Frameworks****Android SDK**.
43+
:::
4044

4145
Select the "SDK Platforms" tab from within the SDK Manager, then check the box next to "Show Package Details" in the bottom right corner. Look for and expand the `Android 15 (VanillaIceCream)` entry, then make sure the following items are checked:
4246

@@ -59,17 +63,23 @@ export PATH=$PATH:$ANDROID_HOME/emulator
5963
export PATH=$PATH:$ANDROID_HOME/platform-tools
6064
```
6165

62-
> `.bash_profile` is specific to `bash`. If you're using another shell, you will need to edit the appropriate shell-specific config file.
66+
:::note
67+
`.bash_profile` is specific to `bash`. If you're using another shell, you will need to edit the appropriate shell-specific config file.
68+
:::
6369

6470
Type `source $HOME/.bash_profile` for `bash` or `source $HOME/.zprofile` to load the config into your current shell. Verify that ANDROID_HOME has been set by running `echo $ANDROID_HOME` and the appropriate directories have been added to your path by running `echo $PATH`.
6571

66-
> Please make sure you use the correct Android SDK path. You can find the actual location of the SDK in the Android Studio "Settings" dialog, under **Languages & Frameworks****Android SDK**.
72+
:::note
73+
Please make sure you use the correct Android SDK path. You can find the actual location of the SDK in the Android Studio "Settings" dialog, under **Languages & Frameworks****Android SDK**.
74+
:::
6775

6876
<h3>Watchman</h3>
6977

7078
Follow the [Watchman installation guide](https://facebook.github.io/watchman/docs/install#buildinstall) to compile and install Watchman from source.
7179

72-
> [Watchman](https://facebook.github.io/watchman/docs/install) is a tool by Facebook for watching changes in the filesystem. It is highly recommended you install it for better performance and increased compatibility in certain edge cases (translation: you may be able to get by without installing this, but your mileage may vary; installing this now may save you from a headache later).
80+
:::info
81+
[Watchman](https://facebook.github.io/watchman/docs/install) is a tool by Facebook for watching changes in the filesystem. It is highly recommended you install it for better performance and increased compatibility in certain edge cases (translation: you may be able to get by without installing this, but your mileage may vary; installing this now may save you from a headache later).
82+
:::
7383

7484
<h2>Preparing the Android device</h2>
7585

@@ -89,7 +99,9 @@ If you use Android Studio to open `./AwesomeProject/android`, you can see the li
8999

90100
If you have recently installed Android Studio, you will likely need to [create a new AVD](https://developer.android.com/studio/run/managing-avds.html). Select "Create Virtual Device...", then pick any Phone from the list and click "Next", then select the **VanillaIceCream** API Level 35 image.
91101

92-
> We recommend configuring [VM acceleration](https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux) on your system to improve performance. Once you've followed those instructions, go back to the AVD Manager.
102+
:::tip
103+
We recommend configuring [VM acceleration](https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux) on your system to improve performance. Once you've followed those instructions, go back to the AVD Manager.
104+
:::
93105

94106
Click "Next" then "Finish" to create your AVD. At this point you should be able to click on the green triangle button next to your AVD to launch it.
95107

docs/_getting-started-macos-android.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ brew install node
1313
brew install watchman
1414
```
1515

16-
If you have already installed Node on your system, make sure it is Node 18.18 or newer.
16+
If you have already installed Node on your system, make sure it is Node 20.19.4 or newer.
1717

1818
[Watchman](https://facebook.github.io/watchman) is a tool by Facebook for watching changes in the filesystem. It is highly recommended you install it for better performance.
1919

@@ -65,7 +65,9 @@ Setting up your development environment can be somewhat tedious if you're new to
6565

6666
Then, click "Next" to install all of these components.
6767

68-
> If the checkboxes are grayed out, you will have a chance to install these components later on.
68+
::note
69+
If the checkboxes are grayed out, you will have a chance to install these components later on.
70+
:::
6971

7072
Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.
7173

@@ -77,7 +79,9 @@ To do that, open Android Studio, click on "More Actions" button and select "SDK
7779

7880
![Android Studio Welcome](/docs/assets/GettingStartedAndroidStudioWelcomeMacOS.png)
7981

80-
> The SDK Manager can also be found within the Android Studio "Settings" dialog, under **Languages & Frameworks****Android SDK**.
82+
:::tip
83+
The SDK Manager can also be found within the Android Studio "Settings" dialog, under **Languages & Frameworks****Android SDK**.
84+
:::
8185

8286
Select the "SDK Platforms" tab from within the SDK Manager, then check the box next to "Show Package Details" in the bottom right corner. Look for and expand the `Android 15 (VanillaIceCream)` entry, then make sure the following items are checked:
8387

@@ -102,7 +106,9 @@ export PATH=$PATH:$ANDROID_HOME/platform-tools
102106

103107
Run `source ~/.zprofile` (or `source ~/.bash_profile` for `bash`) to load the config into your current shell. Verify that ANDROID_HOME has been set by running `echo $ANDROID_HOME` and the appropriate directories have been added to your path by running `echo $PATH`.
104108

105-
> Please make sure you use the correct Android SDK path. You can find the actual location of the SDK in the Android Studio "Settings" dialog, under **Languages & Frameworks****Android SDK**.
109+
:::note
110+
Please make sure you use the correct Android SDK path. You can find the actual location of the SDK in the Android Studio "Settings" dialog, under **Languages & Frameworks****Android SDK**.
111+
:::
106112

107113
<h2>Preparing the Android device</h2>
108114

docs/_getting-started-macos-ios.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ brew install node
1313
brew install watchman
1414
```
1515

16-
If you have already installed Node on your system, make sure it is Node 18.18 or newer.
16+
If you have already installed Node on your system, make sure it is Node 20.19.4 or newer.
1717

1818
[Watchman](https://facebook.github.io/watchman) is a tool by Facebook for watching changes in the filesystem. It is highly recommended you install it for better performance.
1919

docs/_getting-started-windows-android.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,13 @@ choco install -y nodejs-lts microsoft-openjdk17
2020

2121
If you have already installed Node on your system, make sure it is Node 18 or newer. If you already have a JDK on your system, we recommend JDK17. You may encounter problems using higher JDK versions.
2222

23-
> You can find additional installation options on [Node's Downloads page](https://nodejs.org/en/download/).
23+
:::note
24+
You can find additional installation options on [Node's Downloads page](https://nodejs.org/en/download/).
25+
:::
2426

25-
> If you're using the latest version of Java Development Kit, you'll need to change the Gradle version of your project so it can recognize the JDK. You can do that by going to `{project root folder}\android\gradle\wrapper\gradle-wrapper.properties` and changing the `distributionUrl` value to upgrade the Gradle version. You can check out [here the latest releases of Gradle](https://gradle.org/releases/).
27+
:::info
28+
If you're using the latest version of Java Development Kit, you'll need to change the Gradle version of your project so it can recognize the JDK. You can do that by going to `{project root folder}\android\gradle\wrapper\gradle-wrapper.properties` and changing the `distributionUrl` value to upgrade the Gradle version. You can check out [here the latest releases of Gradle](https://gradle.org/releases/).
29+
:::
2630

2731
<h3>Android development environment</h3>
2832

@@ -39,7 +43,9 @@ Setting up your development environment can be somewhat tedious if you're new to
3943

4044
Then, click "Next" to install all of these components.
4145

42-
> If the checkboxes are grayed out, you will have a chance to install these components later on.
46+
:::note
47+
If the checkboxes are grayed out, you will have a chance to install these components later on.
48+
:::
4349

4450
Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.
4551

@@ -51,7 +57,9 @@ To do that, open Android Studio, click on "More Actions" button and select "SDK
5157

5258
![Android Studio Welcome](/docs/assets/GettingStartedAndroidStudioWelcomeWindows.png)
5359

54-
> The SDK Manager can also be found within the Android Studio "Settings" dialog, under **Languages & Frameworks****Android SDK**.
60+
:::tip
61+
The SDK Manager can also be found within the Android Studio "Settings" dialog, under **Languages & Frameworks****Android SDK**.
62+
:::
5563

5664
Select the "SDK Platforms" tab from within the SDK Manager, then check the box next to "Show Package Details" in the bottom right corner. Look for and expand the `Android 15 (VanillaIceCream)` entry, then make sure the following items are checked:
5765

@@ -120,7 +128,9 @@ If you use Android Studio to open `./AwesomeProject/android`, you can see the li
120128

121129
If you have recently installed Android Studio, you will likely need to [create a new AVD](https://developer.android.com/studio/run/managing-avds.html). Select "Create Virtual Device...", then pick any Phone from the list and click "Next", then select the **VanillaIceCream** API Level 35 image.
122130

123-
> If you don't have HAXM installed, click on "Install HAXM" or follow [these instructions](https://github.com/intel/haxm/wiki/Installation-Instructions-on-Windows) to set it up, then go back to the AVD Manager.
131+
:::note
132+
If you don't have HAXM installed, click on "Install HAXM" or follow [these instructions](https://github.com/intel/haxm/wiki/Installation-Instructions-on-Windows) to set it up, then go back to the AVD Manager.
133+
:::
124134

125135
Click "Next" then "Finish" to create your AVD. At this point you should be able to click on the green triangle button next to your AVD to launch it.
126136

docs/_remove-global-cli.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
> If you previously installed a global `react-native-cli` package, please remove it as it may cause unexpected issues:
2-
>
3-
> ```shell
4-
> npm uninstall -g react-native-cli @react-native-community/cli
5-
> ```
1+
:::warning
2+
If you previously installed a global `react-native-cli` package, please remove it as it may cause unexpected issues:
3+
4+
```shell
5+
npm uninstall -g react-native-cli @react-native-community/cli
6+
```
7+
8+
:::

docs/accessibility.md

Lines changed: 100 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ title: Accessibility
44
description: Create mobile apps accessible to assistive technology with React Native's suite of APIs designed to work with Android and iOS.
55
---
66

7+
import ExperimentalAPIWarning from './\_experimental-api-warning.mdx';
8+
79
Both Android and iOS provide APIs for integrating apps with assistive technologies like the bundled screen readers VoiceOver (iOS) and TalkBack (Android). React Native has complementary APIs that let your app accommodate all users.
810

911
:::info
@@ -222,9 +224,9 @@ For example, in a window that contains sibling views `A` and `B`, setting `acces
222224

223225
### `accessibilityElementsHidden` <div className="label ios">iOS</div>
224226

225-
A boolean value indicating whether the accessibility elements contained within this accessibility element are hidden.
227+
A boolean value indicating whether the given accessibility element, and any accessibility elements it contains, are hidden.
226228

227-
For example, in a window that contains sibling views `A` and `B`, setting `accessibilityElementsHidden` to `true` on view `B` causes VoiceOver to ignore the elements in view `B`. This is similar to the Android property `importantForAccessibility="no-hide-descendants"`.
229+
For example, in a window that contains sibling views `A` and `B`, setting `accessibilityElementsHidden` to `true` on view `B` causes VoiceOver to ignore the `B` view and any elements it contains. This is similar to the Android property `importantForAccessibility="no-hide-descendants"`.
228230

229231
### `aria-valuemax`
230232

@@ -276,17 +278,17 @@ Indicates whether an expandable element is currently expanded or collapsed.
276278

277279
### `aria-hidden`
278280

279-
Indicates whether the accessibility elements contained within this accessibility element are hidden.
281+
Indicates whether the element is hidden from assistive technologies.
280282

281-
For example, in a window that contains sibling views `A` and `B`, setting `aria-hidden` to `true` on view `B` causes VoiceOver to ignore the elements in view `B`.
283+
For example, in a window that contains sibling views `A` and `B`, setting `aria-hidden` to `true` on view `B` causes VoiceOver to ignore the `B` element and its children.
282284

283285
| Type | Default |
284286
| ------- | ------- |
285287
| boolean | false |
286288

287289
### `aria-label`
288290

289-
Defines a string value that labels an interactive element.
291+
Defines a string value that can be used to name an element.
290292

291293
| Type |
292294
| ------ |
@@ -337,6 +339,99 @@ Indicates whether a selectable element is currently selected or not.
337339
| ------- |
338340
| boolean |
339341

342+
### `experimental_accessibilityOrder`
343+
344+
<ExperimentalAPIWarning />
345+
346+
:::note
347+
For the sake of brevity, layout is excluded in the following examples even though it dictates the default focus order. Assume the document order matches the layout order.
348+
:::
349+
350+
`experimental_accessibilityOrder` lets you define the order in which assistive technologies focus descendant components. It is an array of [`nativeIDs`](view.md#nativeid) that are set on the components whose order you are controlling. For example:
351+
352+
```
353+
<View experimental_accessibilityOrder={['B', 'C', 'A']}>
354+
<View accessible={true} nativeID="A"/>
355+
<View accessible={true} nativeID="B"/>
356+
<View accessible={true} nativeID="C"/>
357+
</View>
358+
```
359+
360+
Assistive technologies will focus the `View` with `nativeID` of `B`, then `C`, then `A`.
361+
362+
`experimental_accessibilityOrder` will not “turn on” accessibility for the components it references, that still needs to be done. So if we remove `accessible={true}` on `C` above like so
363+
364+
```
365+
<View experimental_accessibilityOrder={['B', 'C', 'A']}>
366+
<View accessible={true} nativeID="A"/>
367+
<View accessible={true} nativeID="B"/>
368+
<View nativeID="C"/>
369+
</View>
370+
```
371+
372+
then the new order will be `B` then `A`, even though `C` is still in `experimental_accessibilityOrder`.
373+
374+
`experimental_accessibilityOrder` will “turn off” accessibility of components it doesn’t reference, however.
375+
376+
```
377+
<View experimental_accessibilityOrder={['B', 'C', 'A']}>
378+
<View accessible={true} nativeID="A"/>
379+
<View accessible={true} nativeID="B"/>
380+
<View accessible={true} nativeID="C"/>
381+
<View accessible={true} nativeID="D"/>
382+
</View>
383+
```
384+
385+
The order of the above example would be `B`, `C`, `A`. `D` will never get focused. In this sense `experimental_accessibilityOrder` is _exhaustive_.
386+
387+
There are still valid reasons to include an non-accessible component in `experimental_accessibilityOrder`. Consider
388+
389+
```
390+
<View experimental_accessibilityOrder={['B', 'C', 'A']}>
391+
<View accessible={true} nativeID="A"/>
392+
<View accessible={true} nativeID="B"/>
393+
<View nativeID="C">
394+
<View accessible={true} nativeID="D"/>
395+
<View accessible={true} nativeID="E"/>
396+
<View accessible={true} nativeID="F"/>
397+
</View>
398+
</View>
399+
```
400+
401+
The focus order will be `B`, `D`, `E`, `F`, `A`. Even though `D`, `E`, and `F` are not directly referenced in `experimental_accessibilityOrder`, `C` is directly referenced. In this instance `C` in an _accessibility container_ - it contains accessible elements, but is not accessible itself. If an accessibility container is referenced in `experimental_accessibilityOrder` then the default order of the elements it contains is applied. In this sense `experimental_accessibilityOrder` is _nestable_.
402+
403+
`experimental_accessibilityOrder` can also reference another component with `experimental_accessibilityOrder`
404+
405+
```
406+
<View experimental_accessibilityOrder={['B', 'C', 'A']}>
407+
<View accessible={true} nativeID="A"/>
408+
<View accessible={true} nativeID="B"/>
409+
<View nativeID="C" experimental_accessibilityOrder={['F', 'E', 'D']}>
410+
<View accessible={true} nativeID="D"/>
411+
<View accessible={true} nativeID="E"/>
412+
<View accessible={true} nativeID="F"/>
413+
</View>
414+
</View>
415+
```
416+
417+
The focus order will be `B`, `F`, `E`, `D`, `A`.
418+
419+
A component cannot be both an accessibility container and an accessibility element (`accessible={true}`). So if we have
420+
421+
```
422+
<View experimental_accessibilityOrder={['B', 'C', 'A']}>
423+
<View accessible={true} nativeID="A"/>
424+
<View accessible={true} nativeID="B"/>
425+
<View accessible={true} nativeID="C" experimental_accessibilityOrder={['F', 'E', 'D']}>
426+
<View accessible={true} nativeID="D"/>
427+
<View accessible={true} nativeID="E"/>
428+
<View accessible={true} nativeID="F"/>
429+
</View>
430+
</View>
431+
```
432+
433+
The focus order would be `B`, `C`, `A`. `D`, `E`, and `F` are no longer in a container, so the exhaustive nature of `experimental_accessibilityOrder` means they will be excluded.
434+
340435
### `importantForAccessibility` <div className="label android">Android</div>
341436

342437
In the case of two overlapping UI components with the same parent, default accessibility focus can have unpredictable behavior. The `importantForAccessibility` property will resolve this by controlling if a view fires accessibility events and if it is reported to accessibility services. It can be set to `auto`, `yes`, `no` and `no-hide-descendants` (the last value will force accessibility services to ignore the component and all of its children).

docs/accessibilityinfo.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,9 @@ static isAccessibilityServiceEnabled(): Promise<boolean>;
158158

159159
Check whether any accessibility service is enabled. This includes TalkBack but also any third-party accessibility app that may be installed. To only check whether TalkBack is enabled, use [isScreenReaderEnabled](#isscreenreaderenabled). Returns a promise which resolves to a boolean. The result is `true` when some accessibility services is enabled and `false` otherwise.
160160

161-
> **Note**: Please use [isScreenReaderEnabled](#isscreenreaderenabled) if you only want to check the status of TalkBack.
161+
:::note
162+
Please use [`isScreenReaderEnabled`](#isscreenreaderenabled) if you only want to check the status of TalkBack.
163+
:::
162164

163165
---
164166

@@ -242,4 +244,6 @@ Set accessibility focus to a React component.
242244

243245
On Android, this calls `UIManager.sendAccessibilityEvent` method with passed `reactTag` and `UIManager.AccessibilityEventTypes.typeViewFocused` arguments.
244246

245-
> **Note**: Make sure that any `View` you want to receive the accessibility focus has `accessible={true}`.
247+
:::note
248+
Make sure that any `View` you want to receive the accessibility focus has `accessible={true}`.
249+
:::

0 commit comments

Comments
 (0)