-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Usage with react-query / trpc #24
Comments
I believe onSearch should not handle the fetching logic but rather just pass the debounced search value and leave the developer to handle it himself. In React Query's case, onSearch should only be used to set a state in the parent level which changes the queryKey and therefore, fresh data is passed into the multiselect. |
There's a |
onSearch expects a promise as return type. I might be wrong though but an example with tanstack query would be nice to showcase its usage. |
Sorry, my bad. Maybe lazy query can do the trick. In my project the |
I mean, I can set a state when onSearch executes on this implementation but its expecting me to return a promise and I only want to do something to the parent. |
Let me clarify it: If it does, there's a |
@hsuanyi-chou I tried to add an implementation with trpc, even though im passing the options correctly, I get an empty indicator in the options. |
currently, I dont think its possible to use search with react-query / trpc with how the useSearch option works.
would appreciate if you can make an example with it, thanks!
The text was updated successfully, but these errors were encountered: