How to use TRPC query without hooks
Hi guys! I'm new to TRPC so I see how you can fetch stuff in the backend with trpc using hooks like so
const { data: videos } = api.videos.fetchVideos.useQuery(); but in my case I want to fetch once an action happens and pass in an argument that I get once user submits something. What is the best way to go about this?Solution
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 mutations.
