What happened to the `enabled` option in useQuery?

I recently noticed that in create-t3-appp v10 I no longer have the boolean enabled option available.
const { data: prefs } = trpc.useQuery(['prefs.all'], {
enabled: !!_id,
});
const { data: prefs } = trpc.useQuery(['prefs.all'], {
enabled: !!_id,
});
I realize there's a been a revamp of the api, I'm just wondering if this is still available through another means? Thanks for the help 🙏
6 Replies
cje
cje3y ago
You’re putting it in the wrong place
cje
cje3y ago
useQuery() | tRPC
The hooks provided by @trpc/react-query are a thin wrapper around @tanstack/react-query. For in-depth information about options and usage patterns, refer to their docs on queries.
cje
cje3y ago
First object is input, second object is options
Gaurang
Gaurang3y ago
Thanks @cje, it threw me off because I didn't have any inputs for this particular query, and so the first expected argument (input) is of type void -- I'm not quite sure about what to pass as that first argument in this case.
cje
cje3y ago
Undefined That’s a general JS thing Undefined means the absence of a value
Gaurang
Gaurang3y ago
got it thanks! really appreciate the clarification 🙏
Want results from more Discord servers?
Add your server