Is there a way to set a types for queryClient without casting everytime?
Hello, I have a custom useQuery hook:
I want to access this query using queryClient, but the type is unknown:
is there a way for me to set the types for channels, so that I will be able to access it without having to cast it evertytime i use the getQueryData or setQueryData?
1 Reply
variable-lime•3y ago
nope, you need
querClient.getQueryData<Channels>["channels"]
but out of curiosity: why do you need getQueryData , apart from optimstic updates ?