TRPC query initial undefined
How can I get rid of the undefined issue, the initial trpc request returns undefined, which is causing an error what may I be doing wrong here?
4 Replies
it doesn't return undefined
it is undefined because it hasnt returned yet
@cje yes, whats a good way to check that?
I mean I could do this meanwhile
but not sure if there is a better way
if (!allClients.data) return <LoadingSpinner />
look at what's on the object that the query returns
you have a bunch of stuff like isLoading, isError, etc that you can work withoh right
forgot about that
thank you