TS best practice with `enabled` prop
Hi guys, basically I have an custom useQuery hook with an underlying queryFn that requires certain arguments. Now TS yells at me, because the type checker doesn't know that the query won't get enabled/executed until
isValid=true . How do you guys handle this situation?
I'd love to hear your opinion on this approach.
1 Reply
extended-salmon•3y ago
React Query and TypeScript
Combine two of the most powerful tools for React Apps to produce great user experience, developer experience and type safety.