Return type of useDebouncedCallback is not derived from the passed-in function #6986
moonray
started this conversation in
Feature requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Dependencies check up
What version of @mantine/* packages do you have in package.json?
7.13.2
What package has an issue?
@mantine/hooks
What framework do you use?
Other, I will specify in the bug description
In which browsers you can reproduce the issue?
None
Describe the bug
The return type for useDebouncedCallback is
void
instead of matching the return type of the function that was passed in.So if the callback function returns something other than undefined/void, the return type is incorrect.
EDIT:
Looking more closely at the useDebouncedCallback function it seems it's not built to actually have the debounced function return what the callback function returns. So that would be a good thing to implement. A good example would be the debounce-promise package.
If possible, include a link to a codesandbox with a minimal reproduction
No response
Possible fix
No response
Self-service
Beta Was this translation helpful? Give feedback.
All reactions