how do I get the types from data off of a use query???
const { data, isLoading: isGetListDataLoading } = api.list.getLists.useQuery()
im using this code in a context provider and I want to pass this data down but I can't cause typescript.
3 Replies
Solution
src/utils/api.ts
should export the type RouterOutputs
then you acess with RouterOuputs['some']['router']['operation']['data']
Thanks @nyx (Rustular DevRel) I've been loosing my mind for about 3hrs about how to solve this...thank you. Very new to this stack