Comparing version 0.1.1 to 0.2.0
{ | ||
"name": "use-spring", | ||
"version": "0.1.1", | ||
"main": "index.js", | ||
"version": "0.2.0", | ||
"license": "MIT", | ||
"main": "dist/index.js", | ||
"repository": "https://github.com/pomber/use-spring", | ||
"author": "pomber", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"typings": "dist/index.d.ts", | ||
"files": [ | ||
"dist" | ||
], | ||
"scripts": { | ||
"start": "tsdx watch", | ||
"build": "tsdx build", | ||
"test": "tsdx test --passWithNoTests", | ||
"lint": "tsdx lint", | ||
"prepare": "tsdx build", | ||
"storybook": "start-storybook -p 6006", | ||
"build-storybook": "build-storybook" | ||
}, | ||
"peerDependencies": { | ||
"react": "^16.8.0", | ||
"react-dom": "^16.8.0" | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "tsdx lint" | ||
} | ||
}, | ||
"name": "use-spring", | ||
"author": "Rodrigo Pombo", | ||
"module": "dist/use-spring.esm.js", | ||
"devDependencies": { | ||
"@babel/core": "^7.8.7", | ||
"@storybook/addon-actions": "^5.3.14", | ||
"@storybook/addon-links": "^5.3.14", | ||
"@storybook/addons": "^5.3.14", | ||
"@storybook/react": "^5.3.14", | ||
"@types/jest": "^25.1.4", | ||
"@types/react": "^16.9.23", | ||
"@types/react-dom": "^16.9.5", | ||
"babel-loader": "^8.0.6", | ||
"husky": "^4.2.3", | ||
"react": "^16.8.0", | ||
"react-dom": "^16.8.0", | ||
"ts-loader": "^6.2.1", | ||
"tsdx": "^0.12.3", | ||
"tslib": "^1.11.1", | ||
"typescript": "^3.8.3" | ||
}, | ||
"keywords": [ | ||
@@ -13,0 +50,0 @@ "react", |
# use-spring | ||
[![](https://badgen.net/bundlephobia/minzip/use-spring)](https://bundlephobia.com/result?p=use-spring) ![](https://badgen.net/david/dep/pomber/use-spring) ![](https://badgen.net/npm/types/use-spring) | ||
Install | ||
@@ -19,3 +21,3 @@ | ||
const handleTargetChange = e => setTarget(+e.target.value); | ||
const current = useSpring(target); | ||
const [current] = useSpring(target); | ||
return ( | ||
@@ -34,8 +36,12 @@ <div> | ||
[Demo](https://codesandbox.io/s/use-spring-demo-fbbvn) | ||
## Demos | ||
- [Basic Demo](https://codesandbox.io/s/use-spring-demo-fbbvn) | ||
- [Emoji Heads](https://codesandbox.io/s/use-spring-demo-irfq5?hidenavigation=1) | ||
## API | ||
```js | ||
const x = useSpring(target, { | ||
// default values: | ||
const [x, isMoving] = useSpring(target, { | ||
stiffness: 170, | ||
@@ -45,26 +51,18 @@ damping: 26, | ||
decimals: 2, | ||
teleport: false | ||
teleport: false, | ||
from: target, | ||
initialSpeed: 0 | ||
}); | ||
``` | ||
## MIT License | ||
You can try different values of `stiffness`, `damping` or `mass` on the [Spring Editor](https://springs.pomb.us/). | ||
Copyright (c) 2019 Rodrigo Pombo | ||
## Related | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
- [react-spring](https://github.com/react-spring/react-spring) | ||
- [react-motion](https://github.com/chenglou/react-motion) | ||
- [framer-motion](https://www.framer.com/api/motion/) | ||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
## MIT License | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
Copyright (c) 2019 Rodrigo Pombo |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
58143
14
513
2
16
3
66
2
1