Skip to content

Commit

Permalink
fix: add immediate to dep list (#2167)
Browse files Browse the repository at this point in the history
  • Loading branch information
li-jia-nan committed Apr 23, 2023
1 parent bf4e0ef commit 64479f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/hooks/src/useInterval/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const useInterval = (fn: () => void, delay?: number, options: { immediate?: bool
}
timerRef.current = setInterval(timerCallback, delay);
return clear;
}, [delay]);
}, [delay, options.immediate]);

return clear;
};
Expand Down

0 comments on commit 64479f6

Please sign in to comment.