How to pass TRPC (React Query) refetch() as prop to component in TypeScript?

Trying to pass the function as prop, but I can't figure out how to get the type definition from it. It's super long and I can't copy it from VSCode hover lol
6 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
jack
jack2y ago
yea i got that far, but then there's the issue that there are generic types in there is that part just trivial ?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Sofiane
Sofiane2y ago
Just encapsulate it inside another function and type it as () => void
Amos
Amos2y ago
You could also just
const trpcContext = trpc.useContext();
trpcContext.refetchQueries(['...'], { ... })
const trpcContext = trpc.useContext();
trpcContext.refetchQueries(['...'], { ... })
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server