Skip to content

Commit

Permalink
fix: refresh callback declaration fix in useNavScroll
Browse files Browse the repository at this point in the history
Co-authored-by: Nicola Alessandro Domingo <[email protected]>
  • Loading branch information
Nick87 and Nicola Alessandro Domingo authored May 2, 2024
1 parent 911ebb3 commit 6a9957e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/NavScroll/useNavScroll.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,11 @@ export function useNavScroll(args: useNavScrollArgs = {}): useNavScrollResult {
forceRecompute
]);

const refresh = useCallback(
const refresh = useCallback(() => {
debounce(() => {
setCounter(counter + 1);
}, REGISTER_DELAY),
[counter]
);
}, REGISTER_DELAY);
}, [counter]);

const register = useCallback(
(id, options = {}) => {
Expand Down

0 comments on commit 6a9957e

Please sign in to comment.