Oren
Orenβ€’11mo ago

Hey πŸ‘‹

I'm looking to use tRPC with app-router specifically with this setup; - My pages are RSC, and I want to fetch the data there using trpc route / .query or .fetch (page.tsx), cached - My forms are "client side" I want to mutate using react-query on client side and manually invalidate RSC fetchers above ^ upon mutations Does anyone have an example repo I can investigate to achieve this setup?
1 Reply
PotatisMannen
PotatisMannenβ€’10mo ago
This is actually a really good question. I would love to know how to do this. Maybe there is a way to use next’s route refreshing to cause rsc data to update the page? If not that, then im guessing best option is to only fetch server side data as prefetched data and pass that prefetched data to your query somehow. That way the query client is still responsible for data updates on the client when mutations happen and the rsc data fetch only serves the purpose of prefetching data for initial renders From my understanding thats the intended model from a next point of view