Skip to content

Commit

Permalink
fix(useTimeout): fix immediate option not working
Browse files Browse the repository at this point in the history
  • Loading branch information
vikiboss committed Dec 2, 2024
1 parent 9a07cf7 commit 8edf98d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/react-use/src/use-timeout/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export function useTimeout<C extends AnyFunc>(interval = 1000, options: UseTimeo
latest.current.callback?.(...args)
}) as C,
interval,
{ immediate: !exposeControls, ...options },
{ immediate: immediate ?? !exposeControls, ...options },
)

const reset = useStableFn(() => {
Expand Down

0 comments on commit 8edf98d

Please sign in to comment.