Can I use both raw and react tRPC client?

// Raw client const post = await trpc.post.byId.query({ id: "1" }) const addPost = await trpc.post.add.mutate({ title: "hello world" }) // React const postQuery = trpc.post.byId.useQuery({ id: "1" }) const addPostMutation = trpc.post.add.useMutation()
2 Replies
bnugggets
bnugggets2y ago
yeah i’ve done it. it works. create your vanilla client in another file. import and use it as you would a fetch(). probably in some useEffect or event handler
polioan
polioanOP2y ago
thx king
Want results from more Discord servers?
Add your server