Skip to content

Commit a20fdbe

Browse files
authored
Extract experimental API warning to a separate file (#4791)
1 parent bdee263 commit a20fdbe

File tree

4 files changed

+15
-9
lines changed

4 files changed

+15
-9
lines changed

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/accessibility.md

Lines changed: 4 additions & 3 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
@@ -339,9 +341,8 @@ Indicates whether a selectable element is currently selected or not.
339341

340342
### `experimental_accessibilityOrder`
341343

342-
:::important Experimental 🧪
343-
**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.
344-
:::
344+
<ExperimentalAPIWarning />
345+
345346
:::note
346347
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.
347348
:::

docs/view.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ id: view
33
title: View
44
---
55

6+
import ExperimentalAPIWarning from './\_experimental-api-warning.mdx';
7+
68
The most fundamental component for building a UI, `View` is a container that supports layout with [flexbox](flexbox.md), [style](style.md), [some touch handling](handling-touches.md), and [accessibility](accessibility.md) controls. `View` maps directly to the native view equivalent on whatever platform React Native is running on, whether that is a `UIView`, `<div>`, `android.view`, etc.
79

810
`View` is designed to be nested inside other views and can have 0 to many children of any type.
@@ -385,9 +387,7 @@ Setting to false prevents direct children of the view from being removed from th
385387

386388
### `experimental_accessibilityOrder`
387389

388-
:::important Experimental 🧪
389-
**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.
390-
:::
390+
<ExperimentalAPIWarning />
391391

392392
`experimental_accessibilityOrder` indicates the order in which an assistive technology focuses descendants of this `View`. This prop takes an array of strings where each string is a [`nativeID`](view.md#nativeid) of some descendant component whose order is being defined. This prop does not enable accessibility itself, each referenced component still needs to be accessible by setting [`accessible`](view.md#accessible) to true. This prop is both **nestable** and **exhaustive** meaning
393393

docs/virtualview.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ id: virtualview
33
title: VirtualView 🧪
44
---
55

6-
:::important Experimental 🧪
7-
**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.
8-
:::
6+
import ExperimentalAPIWarning from './\_experimental-api-warning.mdx';
7+
8+
<ExperimentalAPIWarning />
99

1010
`VirtualView` is a core component that behaves similar to [`View`](view).
1111

0 commit comments

Comments
 (0)