Loading state for useQueries? #3777
-
Hi all, What's the most appropriate way to check if all queries within the useQueries hook have finished? Should I just look for "some" query within the array to have status as loading (with something like Array.some) and conclude that all of them have not finished? I currently do something like this, but I am not sure if there's a better way: const someQueries = useQueries(...);
const isLoading = someQueries.some(query => query.status === 'loading'); Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
@asheerrizvi |
Beta Was this translation helpful? Give feedback.
-
Hi, #2004 did not work for me. const someQueries = useQueries(...); then use isQueriesLoaded as a boolean inside the return block of React. |
Beta Was this translation helpful? Give feedback.
@asheerrizvi
Hi. Can it help in your case?
#2004