Skip to content

Commit 33e4587

Browse files
committed
update TV-related props, improve docs formatting
1 parent 371c3bb commit 33e4587

19 files changed

+84
-82
lines changed

docs/alert.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ title: Alert
55

66
Launches an alert dialog with the specified title and message.
77

8-
Optionally provide a list of buttons. Tapping any button will fire the respective onPress callback and dismiss the alert. By default, the only button will be an 'OK' button.
8+
Optionally provide a list of buttons. Tapping any button will fire the respective `onPress` callback and dismiss the alert. By default, the only button will be an 'OK' button.
99

1010
This is an API that works both on Android and iOS and can show static alerts. Alert that prompts the user to enter some information is available on iOS only.
1111

docs/button.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ title: Button
55

66
A basic button component that should render nicely on any platform. Supports a minimal level of customization.
77

8-
If this button doesn't look right for your app, you can build your own button using [Pressable](pressable). For inspiration, look at the [source code for the Button component](https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Components/Button.js).
8+
If this button doesn't look right for your app, you can build your own button using [`Pressable`](pressable). For inspiration, look at the [source code for the `Button` component](https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Components/Button.js).
99

1010
```tsx
1111
<Button
@@ -212,7 +212,11 @@ If `true`, disable all interactions for this component.
212212

213213
---
214214

215-
### `hasTVPreferredFocus` <div className="label tv">TV</div>
215+
### `hasTVPreferredFocus` <div className="label ios">tvOS</div>
216+
217+
:::warning Deprecated
218+
Use [`focusable` prop](view#focusable) form `View` instead.
219+
:::
216220

217221
TV preferred focus.
218222

@@ -222,7 +226,7 @@ TV preferred focus.
222226

223227
---
224228

225-
### `nextFocusDown` <div className="label android">Android</div><div className="label tv">TV</div>
229+
### `nextFocusDown` <div className="label android">Android TV</div>
226230

227231
Designates the next view to receive focus when the user navigates down. See the [Android documentation](https://developer.android.com/reference/android/view/View.html#attr_android:nextFocusDown).
228232

@@ -232,7 +236,7 @@ Designates the next view to receive focus when the user navigates down. See the
232236

233237
---
234238

235-
### `nextFocusForward` <div className="label android">Android</div><div className="label tv">TV</div>
239+
### `nextFocusForward` <div className="label android">Android TV</div>
236240

237241
Designates the next view to receive focus when the user navigates forward. See the [Android documentation](https://developer.android.com/reference/android/view/View.html#attr_android:nextFocusForward).
238242

@@ -242,7 +246,7 @@ Designates the next view to receive focus when the user navigates forward. See t
242246

243247
---
244248

245-
### `nextFocusLeft` <div className="label android">Android</div><div className="label tv">TV</div>
249+
### `nextFocusLeft` <div className="label android">Android TV</div>
246250

247251
Designates the next view to receive focus when the user navigates left. See the [Android documentation](https://developer.android.com/reference/android/view/View.html#attr_android:nextFocusLeft).
248252

@@ -252,7 +256,7 @@ Designates the next view to receive focus when the user navigates left. See the
252256

253257
---
254258

255-
### `nextFocusRight` <div className="label android">Android</div><div className="label tv">TV</div>
259+
### `nextFocusRight` <div className="label android">Android TV</div>
256260

257261
Designates the next view to receive focus when the user navigates right. See the [Android documentation](https://developer.android.com/reference/android/view/View.html#attr_android:nextFocusRight).
258262

@@ -262,7 +266,7 @@ Designates the next view to receive focus when the user navigates right. See the
262266

263267
---
264268

265-
### `nextFocusUp` <div className="label android">Android</div><div className="label tv">TV</div>
269+
### `nextFocusUp` <div className="label android">Android TV</div>
266270

267271
Designates the next view to receive focus when the user navigates up. See the [Android documentation](https://developer.android.com/reference/android/view/View.html#attr_android:nextFocusUp).
268272

docs/debugging.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Alternative (Android): `adb shell input keyevent 82`.
2727
To open DevTools, either:
2828

2929
- Select "Open DevTools" in the Dev Menu.
30-
- Press <kbd>j</kbd> from the CLI (`npx react-native start`).
30+
- Press <kbd>J</kbd> from the CLI (`npx react-native start`).
3131

3232
On first launch, DevTools will open to a welcome panel, along with an open console drawer where you can view logs and interact with the JavaScript runtime. From the top of the window, you can navigate to other panels, including the integrated React Components Inspector and Profiler.
3333

docs/drawerlayoutandroid.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ title: DrawerLayoutAndroid
55

66
import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import constants from '@site/core/TabsConstants';
77

8-
React component that wraps the platform `DrawerLayout` (Android only). The Drawer (typically used for navigation) is rendered with `renderNavigationView` and direct children are the main view (where your content goes). The navigation view is initially not visible on the screen, but can be pulled in from the side of the window specified by the `drawerPosition` prop and its width can be set by the `drawerWidth` prop.
8+
An Android only component that wraps the platform `DrawerLayout`. The Drawer (typically used for navigation) is rendered with `renderNavigationView` and direct children are the main view (where your content goes). The navigation view is initially not visible on the screen, but can be pulled in from the side of the window specified by the `drawerPosition` prop and its width can be set by the `drawerWidth` prop.
99

1010
## Example
1111

@@ -169,7 +169,7 @@ export default App;
169169

170170
# Reference
171171

172-
## Props
172+
## Props <div className="label android">Android</div>
173173

174174
### [View Props](view.md#props)
175175

docs/inputaccessoryview.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ id: inputaccessoryview
33
title: InputAccessoryView
44
---
55

6-
A component which enables customization of the keyboard input accessory view on iOS. The input accessory view is displayed above the keyboard whenever a `TextInput` has focus. This component can be used to create custom toolbars.
6+
An iOS only component which enables customization of the keyboard input accessory view. The input accessory view is displayed above the keyboard whenever a `TextInput` has focus. This component can be used to create custom toolbars.
77

88
To use this component wrap your custom toolbar with the InputAccessoryView component, and set a `nativeID`. Then, pass that `nativeID` as the `inputAccessoryViewID` of whatever `TextInput` you desire. A basic example:
99

@@ -66,7 +66,7 @@ This component can also be used to create sticky text inputs (text inputs which
6666

6767
# Reference
6868

69-
## Props
69+
## Props <div className="label ios">iOS</div>
7070

7171
### `backgroundColor`
7272

docs/interactionmanager.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ title: InteractionManager
55

66
import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import constants from '@site/core/TabsConstants';
77

8-
InteractionManager allows long-running work to be scheduled after any interactions/animations have completed. In particular, this allows JavaScript animations to run smoothly.
8+
`InteractionManager` allows long-running work to be scheduled after any interactions/animations have completed. In particular, this allows JavaScript animations to run smoothly.
99

1010
Applications can schedule tasks to run after interactions with the following:
1111

docs/modal.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ id: modal
33
title: Modal
44
---
55

6-
The Modal component is a basic way to present content above an enclosing view.
6+
The `Modal` component is a basic way to present content above an enclosing view.
77

88
## Example
99

docs/pressable.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ id: pressable
33
title: Pressable
44
---
55

6-
Pressable is a Core Component wrapper that can detect various stages of press interactions on any of its defined children.
6+
`Pressable` is a Core Component wrapper that can detect various stages of press interactions on any of its defined children.
77

88
```tsx
99
<Pressable onPress={onPressFunction}>
@@ -260,9 +260,9 @@ Ripple effect configuration for the `android_ripple` property.
260260

261261
**Properties:**
262262

263-
| Name | Type | Required | Description |
264-
| ---------- | --------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
265-
| color | [color](colors) | No | Defines the color of the ripple effect. |
266-
| borderless | boolean | No | Defines if ripple effect should not include border. |
267-
| radius | number | No | Defines the radius of the ripple effect. |
268-
| foreground | boolean | No | Set to true to add the ripple effect to the foreground of the view, instead of the background. This is useful if one of your child views has a background of its own, or you're e.g. displaying images, and you don't want the ripple to be covered by them. |
263+
| Name | Type | Description |
264+
| ---------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
265+
| color | [color](colors) | Defines the color of the ripple effect. |
266+
| borderless | boolean | Defines if ripple effect should not include border. |
267+
| radius | number | Defines the radius of the ripple effect. |
268+
| foreground | boolean | Set to `true` to add the ripple effect to the foreground of the view, instead of the background. This is useful if one of your child views has a background of its own, or you're e.g. displaying images, and you don't want the ripple to be covered by them. |

docs/refreshcontrol.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ id: refreshcontrol
33
title: RefreshControl
44
---
55

6-
This component is used inside a ScrollView or ListView to add pull to refresh functionality. When the ScrollView is at `scrollY: 0`, swiping down triggers an `onRefresh` event.
6+
This component is used inside a `ScrollView` or `ListView` to add pull to refresh functionality. When the `ScrollView` is at `scrollY: 0`, swiping down triggers an `onRefresh` event.
77

88
## Example
99

docs/scrollview.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ id: scrollview
33
title: ScrollView
44
---
55

6-
Component that wraps platform ScrollView while providing integration with touch locking "responder" system.
6+
Component that wraps platform `ScrollView` while providing integration with touch locking "responder" system.
77

8-
Keep in mind that ScrollViews must have a bounded height in order to work, since they contain unbounded-height children into a bounded container (via a scroll interaction). In order to bound the height of a ScrollView, either set the height of the view directly (discouraged) or make sure all parent views have bounded height. Forgetting to transfer `{flex: 1}` down the view stack can lead to errors here, which the element inspector makes quick to debug.
8+
Keep in mind that scroll views must have a bounded height in order to work, since they contain unbounded-height children into a bounded container (via a scroll interaction). In order to bound the height of a `ScrollView`, either set the height of the view directly (discouraged) or make sure all parent views have bounded height. Forgetting to transfer `{flex: 1}` down the view stack can lead to errors here, which the element inspector makes quick to debug.
99

1010
Doesn't yet support other contained responders from blocking this scroll view from becoming the responder.
1111

12-
`<ScrollView>` vs [`<FlatList>`](flatlist.md) - which one to use?
12+
#### `<ScrollView>` vs [`<FlatList>`](flatlist.md) - which one to use?
1313

1414
`ScrollView` renders all its react child components at once, but this has a performance downside.
1515

0 commit comments

Comments
 (0)