Skip to content

Commit

Permalink
Fix setDirection triggering twice
Browse files Browse the repository at this point in the history
  • Loading branch information
rajatkantinandi committed Jan 1, 2020
1 parent 6603ef7 commit 759e698
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "use-swipe-hook",
"version": "1.0.3",
"version": "1.0.4",
"description": "A simple and easy to use tiny library that provides useSwipe hook to use with React that enables swipe gestures for touch screens",
"main": "lib/index.umd.js",
"browser": "lib/index.umd.js",
Expand Down
2 changes: 1 addition & 1 deletion src/useSwipe.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const useSwipe = ({ ref, thresholdPX = 5 }) => {
setDirection(y2 > y1 ? 'down' : 'up');
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [x2, y2, thresholdPX]);
}, [y2]);

React.useEffect(() => {
const currentElement = ref.current;
Expand Down

0 comments on commit 759e698

Please sign in to comment.