[change] Deprecate Touchables and Button components

These components have been replaced by Pressable and will be removed
from React Native.

Fix #2382
This commit is contained in:
Nicolas Gallagher
2022-09-01 15:08:39 -07:00
committed by Nicolas Gallagher
parent e8a0cbc60a
commit a33c322152
15 changed files with 51 additions and 277 deletions
@@ -1,58 +0,0 @@
---
title: Button
date: Last Modified
permalink: /docs/button/index.html
eleventyNavigation:
key: Button
parent: Components
---
{% import "fragments/macros.html" as macro with context %}
:::lead
A basic button component. Supports a minimal level of customization.
:::
You can also build a custom button using `Pressable`.
```jsx
import { Button } from 'react-native';
<Button {...props} />;
```
---
## API
### Props
{% call macro.prop('accessibilityLabel', '?string') %}
Equivalent to [aria-label](https://www.w3.org/TR/wai-aria-1.2/#aria-label).
{% endcall %}
{% call macro.prop('color', '?string') %}
Default `"#2196F3"`. Set the background color of the button.
{% endcall %}
{% call macro.prop('disabled', '?boolean') %}
Prevent all interactions with the button.
{% endcall %}
{% call macro.prop('onPress', '?(e: ClickEvent) => void') %}
Called when the button is pressed by a pointer or keyboard.
{% endcall %}
{% call macro.prop('testID', '?string') %}
Set the test selector label (via `data-testid`).
{% endcall %}
{% call macro.prop('title', 'string') %}
Set the text content of the button.
{% endcall %}
---
## Examples
{{ macro.codesandbox('button') }}
@@ -1,25 +0,0 @@
---
title: Touchables
date: Last Modified
permalink: /docs/touchables/index.html
eleventyNavigation:
key: Touchables
parent: Components
---
{% import "fragments/macros.html" as macro with context %}
:::lead
Components for making views respond to touch, mouse, and keyboard on web.
:::
Please refer to the React Native documentation below:
* [TouchableHighlight](https://reactnative.dev/docs/touchablehighlight)
* [TouchableOpacity](https://reactnative.dev/docs/touchableopacity)
* [TouchableWithoutFeedback](https://reactnative.dev/docs/touchablewithoutfeedback)
:::callout
**Did you know?** The [Pressable]({{ '/docs/pressable' | url }}) component is a more accessible, flexible, and future-proof way to handle tap and click interactions with React Native.
:::