Skip to content

Commit

Permalink
feat(🆕): Add new components
Browse files Browse the repository at this point in the history
Add the Interactable and ReText components. See documentation.
  • Loading branch information
wcandillon committed May 2, 2019
1 parent 6287cae commit 35312c5
Show file tree
Hide file tree
Showing 5 changed files with 2,207 additions and 1,516 deletions.
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,34 @@ import {atan2} from "react-native-redash";
atan2(y, x)
```

## Components

### `<Interactable>`

Implementation of `Interactable` from `react-native-interactable` with `react-native-gesture-handler` and `react-native-reanimated`.
The original implementation has been built by (the reanimated team)[https://github.com/kmagiera/react-native-reanimated/blob/master/Example/Interactable.js].
Documentation of this component is available (here)[https://github.com/wix/react-native-interactable].

Example usage:

```js
<Interactable
snapPoints={[{ x: -width }, { x: 0 }, { x: width }]}
style={{...StyleSheet.absoluteFillObject, backgroundColor: "blue" }}
onSnap={() => alert("oh snap!")}
/>
```

### `<ReText>`

Component that display an animation value as text.

Example usage:

```js
<ReText text={new Value("hello world!")} style={{ color: "blue" }} />
```

## Math

### `toRad(node)`
Expand Down
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Utility library for React Native Reanimated",
"main": "lib/module/index.js",
"scripts": {
"lint": "eslint src/index.ts",
"lint": "eslint src/**/*",
"tsc": "tsc --noEmit",
"test": "npm run lint && npm run",
"prepare": "bob build",
Expand All @@ -23,6 +23,7 @@
"peerDependencies": {
"react": "*",
"react-native": "*",
"react-native-gesture-handler": "*",
"react-native-reanimated": "*"
},
"devDependencies": {
Expand All @@ -31,6 +32,9 @@
"@types/react-native": "^0.57.51",
"eslint": "^5.16.0",
"eslint-config-react-native-wcandillon": "^1.0.6",
"react": "^16.8.6",
"react-native": "^0.59.5",
"react-native-gesture-handler": "^1.2.1",
"react-native-reanimated": "^1.0.1",
"semantic-release": "^15.13.3",
"semantic-release-cli": "^4.1.2"
Expand Down
Loading

0 comments on commit 35312c5

Please sign in to comment.