Skip to content

Commit f2a7289

Browse files
committed
fix: thr value
1 parent 43a6b49 commit f2a7289

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,5 @@
4646
"generate": "rollup -c"
4747
},
4848
"type": "module",
49-
"version": "0.0.5"
49+
"version": "0.0.6"
5050
}

src/hooks/useDetectScroll.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { useState, useEffect } from "react";
22
import PropTypes from "prop-types";
33

4-
function useDetectScroll({ thr = 0, up = "up", down = "down" }) {
4+
function useDetectScroll({ thr, up = "up", down = "down" }) {
55
const [scrollDir, setScrollDir] = useState(down);
66

77
useEffect(() => {
8-
const threshold = thr >= 0 ? 0 : thr;
8+
const threshold = thr ? (thr > 0 ? thr : 0) : 0;
99
let lastScrollY = window.pageYOffset;
1010
let ticking = false;
1111

0 commit comments

Comments
 (0)