-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Closed
Description
when using a 'lazy' query (i.e. passing in a falsey value for the queryKey), the status is indefinitely set to "loading." even though the status will never change from that, this can cause bugs in the UI where folks will be rendering a spinner. Seems to make more sense to have status default to 'success' if the queryKey is falsey and only be 'loading' when the key is truthy.
i.e.
const {status} = useQuery(false && myKey, fetcher)status === "success"
const {status} = useQuery(true && myKey, fetcher)status === "loading"
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels