Disabled tRPC Query, default inputs

I have to wait for some data to exist before running the query. Typescript complains that I need to pass a string so I have to put a useless default in my query input (selectedBatch?._id || ""). Is there a better/cleaner way to do this?
api.bri.useQuery(
selectedBatch?._id || "",
{
enabled: !!selectedBatch,
}
);
api.bri.useQuery(
selectedBatch?._id || "",
{
enabled: !!selectedBatch,
}
);
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server