makoM
tRPC3y ago
7 replies
mako

Skipping useQuery with typescript

I'm wondering if there is a way to skip a query in a typescript friendly way? rtk-query has a handy skipToken that can be used to opt out of the query (https://redux-toolkit.js.org/rtk-query/usage-with-typescript#skipping-queries-with-typescript-using-skiptoken). I see that tanstack has an enabled option, however, it seems with the trpc react hook API you must still pass a typesafe query input.

Is there anything I'm missing? How is this intended to work?
RTK Query > TypeScript: Instructions on how to use RTK Query with TypeScript
Usage With TypeScript | Redux Toolkit
Was this page helpful?