react-with-gesture
Advanced tools
Comparing version 2.0.1 to 2.0.2
@@ -50,6 +50,2 @@ import React from 'react'; | ||
function _readOnlyError(name) { | ||
throw new Error("\"" + name + "\" is read-only"); | ||
} | ||
var initialState = { | ||
@@ -181,5 +177,6 @@ x: 0, | ||
_this._state = initialstate; | ||
set = (_readOnlyError("set"), function (cb) { | ||
set = function set(cb) { | ||
return _this._state = cb(_this._state); | ||
}); | ||
}; | ||
} | ||
@@ -186,0 +183,0 @@ |
@@ -56,6 +56,2 @@ 'use strict'; | ||
function _readOnlyError(name) { | ||
throw new Error("\"" + name + "\" is read-only"); | ||
} | ||
var initialState = { | ||
@@ -187,5 +183,6 @@ x: 0, | ||
_this._state = initialstate; | ||
set = (_readOnlyError("set"), function (cb) { | ||
set = function set(cb) { | ||
return _this._state = cb(_this._state); | ||
}); | ||
}; | ||
} | ||
@@ -192,0 +189,0 @@ |
{ | ||
"name": "react-with-gesture", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "hoc for receiving gestures", | ||
@@ -5,0 +5,0 @@ "main": "dist/react-with-gesture", |
@@ -74,3 +74,3 @@ npm install react-with-gesture | ||
```jsx | ||
import { useSpring } from 'react-with-gesture' | ||
import { useGesture } from 'react-with-gesture' | ||
@@ -86,1 +86,9 @@ function App() { | ||
``` | ||
### Transient mode | ||
Provide the `transient` flag and it won't cause new render passes, instead you will be notified through the `onAction` callback. This works the same for Hoc's, render-props and hooks. | ||
```jsx | ||
const [handlers] = useGesture({ transient: true, onAction: e => console.log(e) }) | ||
``` |
@@ -106,3 +106,3 @@ import React from 'react' | ||
this.state = initialstate | ||
const set = this.setState.bind(this) | ||
let set = this.setState.bind(this) | ||
if (props.transient) { | ||
@@ -109,0 +109,0 @@ this._state = initialstate |
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
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
89321
93
641