Custom useQuery Typesafe
Hi guys, I have a custom hook that wraps useQuery like this:
The
useUserData hook relies on the result of useUser, but I want to maintain isLoading and isError states for component usage. Is there a better or more straightforward way to achieve this functionality ?1 Reply
manual-pink•3y ago
type inference
additionally, you can use
satisfies DataResult at the end to adhere to an interface but still get type inference