Skip to content

[BUG] useDebounceValue - delay parameter should be optional #694

@moloko

Description

@moloko

Describe the bug

The documentation for useDebounceValue states that 'default is 500ms' which implies that this parameter should be optional - like it is for useDebounceCallback - but it's not...

To Reproduce

Try using useDebounceValue in a TypeScript project, without passing a delay parameter. Observe that TypeScript throws an error saying 'Expected 2-3 arguments, but got 1.'

Expected behavior

You should be able to omit the delay parameter to have it default to 500ms, just like you can with useDebounceCallback

Additional context

https://usehooks-ts.com/react-hook/use-debounce-callback#api

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions