useAsyncList prevent initial fetch - provide predicate? #4014
Unanswered
binaryartifex
asked this question in
Q&A
Replies: 1 comment 1 reply
-
You can just add an early return to your async load({ signal, cursor, filterText }) {
if (!filterText || filterText.length < 3) return {items: []};
// ...
} |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Im following along with this example here of how to make the humble search field. requirements are simple - no fetching until at least 3 debounced characters are ready to provide as the initial query. No client side filtering necessary as the api response has that handled. The response popover should be navigable via the up and down arrows while permitting further typing, which i belief useComboBox already does. Onpress for any option simply navigates to that particular page. I "think" i can achieve most of this with react-aria, but im stuck on enforcing some type of predicate against the useAsyncList on initial render, as these search items are information rich and an initial search on an empty string is expensive....
Beta Was this translation helpful? Give feedback.
All reactions