mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-05-24 23:25:40 +00:00
[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:
committed by
Nicolas Gallagher
parent
e8a0cbc60a
commit
a33c322152
@@ -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.
|
||||
:::
|
||||
Reference in New Issue
Block a user