Skip to content

Commit 9cfe859

Browse files
committed
Update pressable (remove deprecated example)
1 parent 8dcddbf commit 9cfe859

File tree

1 file changed

+2
-18
lines changed

1 file changed

+2
-18
lines changed

docs/pressable.md

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ officialDoc: https://reactnative.dev/docs/pressable
66

77
Pressable is a Core Component wrapper that can detect various stages of press interactions on any of it's defined children.
88

9-
⚠️ Current `Pressable` is deprecated, prefer `Pressable_` that offers interaction states (eg: `pressed` state).
10-
119
## How it works
1210

1311
On an element wrapped by `Pressable`:
@@ -19,32 +17,18 @@ You can read more about this [on the official Pressable documentation](https://r
1917

2018
## Example
2119

22-
Current Pressable (deprecated because doesn't provide pressed state).
23-
24-
```rescript
25-
open ReactNative
26-
27-
@react.component
28-
let make = () =>
29-
<Pressable onPress={_ => Js.log("Pressed")}>
30-
<Text> {"Press Me"->React.string} </Text>
31-
</Pressable>
32-
```
33-
34-
Next Pressable (with interactionState)
35-
3620
```rescript
3721
open ReactNative
3822
3923
@react.component
4024
let make = () =>
41-
<Pressable_
25+
<Pressable
4226
onPress={_ => Js.log("Pressed")}
4327
style={({pressed}) => {
4428
open Style
4529
style(~backgroundColor=pressed ? "rgb(210, 230, 255)" : "white", ())
4630
}}>
4731
{({pressed}) =>
4832
<Text> {(pressed ? "Pressed!" : "Press Me")->React.string} </Text>}
49-
</Pressable_>
33+
</Pressable>
5034
```

0 commit comments

Comments
 (0)