Skip to content

Commit

Permalink
fix: Node.JS.Timeout error
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruslan Bagautdinov committed Jul 16, 2024
1 parent 19c6b5b commit 0aeca29
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/SubNavigation/SubNavigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const SubNavigation = ({
closeMiniToc,
}: SubNavigationProps) => {
const [visibility, setVisibility] = useState(true);
const [hiddingTimeout, setHiddingTimeout] = useState<NodeJS.Timeout | undefined>(undefined);
const [hiddingTimeout, setHiddingTimeout] = useState<number | undefined>(undefined);
const [lastScrollY, setLastScrollY] = useState(window.screenY);

const shareData = useMemo(() => {
Expand Down Expand Up @@ -82,7 +82,7 @@ export const SubNavigation = ({
setVisibility(false);

setHiddingTimeout(
setTimeout(() => {
window.setTimeout(() => {
clearTimeout(hiddingTimeout);
setHiddingTimeout(undefined);
}, 300),
Expand Down Expand Up @@ -118,7 +118,7 @@ export const SubNavigation = ({
}

setHiddingTimeout(
setTimeout(() => {
window.setTimeout(() => {
setHiddingTimeout(undefined);
}, 100),
);
Expand Down

0 comments on commit 0aeca29

Please sign in to comment.