react-ui-animate 5.0.0-alpha.2 → 5.0.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -177,10 +177,10 @@ import React from 'react';
|
|
|
177
177
|
import { useValue, animate, useDrag, withSpring } from 'react-ui-animate';
|
|
178
178
|
|
|
179
179
|
export const Draggable: React.FC = () => {
|
|
180
|
-
const translateX = useValue(0);
|
|
180
|
+
const [translateX, setTranslateX] = useValue(0);
|
|
181
181
|
|
|
182
182
|
const bind = useDrag(({ down, movementX }) => {
|
|
183
|
-
|
|
183
|
+
setTranslateX(down ? movementX : withSpring(0));
|
|
184
184
|
});
|
|
185
185
|
|
|
186
186
|
return (
|
|
@@ -190,7 +190,7 @@ export const Draggable: React.FC = () => {
|
|
|
190
190
|
width: 100,
|
|
191
191
|
height: 100,
|
|
192
192
|
backgroundColor: '#3399ff',
|
|
193
|
-
translateX
|
|
193
|
+
translateX,
|
|
194
194
|
}}
|
|
195
195
|
/>
|
|
196
196
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-ui-animate",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.3",
|
|
4
4
|
"description": "React library for gestures and animation",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"peerDependencies": {
|
|
@@ -32,7 +32,9 @@
|
|
|
32
32
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
33
33
|
"version:minor": "npm version --no-git-tag-version minor",
|
|
34
34
|
"version:major": "npm version --no-git-tag-version major",
|
|
35
|
-
"version:patch": "npm version --no-git-tag-version patch"
|
|
35
|
+
"version:patch": "npm version --no-git-tag-version patch",
|
|
36
|
+
"publish:next": "npm publish --tag next",
|
|
37
|
+
"publish:latest": "npm publish --tag latest"
|
|
36
38
|
},
|
|
37
39
|
"repository": {
|
|
38
40
|
"type": "git",
|