Skip to content

Commit 35312c5

Browse files
committed
feat(🆕): Add new components
Add the Interactable and ReText components. See documentation.
1 parent 6287cae commit 35312c5

File tree

5 files changed

+2207
-1516
lines changed

5 files changed

+2207
-1516
lines changed

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,34 @@ import {atan2} from "react-native-redash";
1717
atan2(y, x)
1818
```
1919

20+
## Components
21+
22+
### `<Interactable>`
23+
24+
Implementation of `Interactable` from `react-native-interactable` with `react-native-gesture-handler` and `react-native-reanimated`.
25+
The original implementation has been built by (the reanimated team)[https://github.com/kmagiera/react-native-reanimated/blob/master/Example/Interactable.js].
26+
Documentation of this component is available (here)[https://github.com/wix/react-native-interactable].
27+
28+
Example usage:
29+
30+
```js
31+
<Interactable
32+
snapPoints={[{ x: -width }, { x: 0 }, { x: width }]}
33+
style={{...StyleSheet.absoluteFillObject, backgroundColor: "blue" }}
34+
onSnap={() => alert("oh snap!")}
35+
/>
36+
```
37+
38+
### `<ReText>`
39+
40+
Component that display an animation value as text.
41+
42+
Example usage:
43+
44+
```js
45+
<ReText text={new Value("hello world!")} style={{ color: "blue" }} />
46+
```
47+
2048
## Math
2149

2250
### `toRad(node)`

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "Utility library for React Native Reanimated",
55
"main": "lib/module/index.js",
66
"scripts": {
7-
"lint": "eslint src/index.ts",
7+
"lint": "eslint src/**/*",
88
"tsc": "tsc --noEmit",
99
"test": "npm run lint && npm run",
1010
"prepare": "bob build",
@@ -23,6 +23,7 @@
2323
"peerDependencies": {
2424
"react": "*",
2525
"react-native": "*",
26+
"react-native-gesture-handler": "*",
2627
"react-native-reanimated": "*"
2728
},
2829
"devDependencies": {
@@ -31,6 +32,9 @@
3132
"@types/react-native": "^0.57.51",
3233
"eslint": "^5.16.0",
3334
"eslint-config-react-native-wcandillon": "^1.0.6",
35+
"react": "^16.8.6",
36+
"react-native": "^0.59.5",
37+
"react-native-gesture-handler": "^1.2.1",
3438
"react-native-reanimated": "^1.0.1",
3539
"semantic-release": "^15.13.3",
3640
"semantic-release-cli": "^4.1.2"

0 commit comments

Comments
 (0)