How to invalidate query made by trpc inside a RSC

In the root page which is a server component, I have fetched some data like this
const posts = await api.posts.list({});


And I have passed the posts into another component that is a client component, so when we update a post from that client component how can we invalidate the posts in the root page

important notes
  • I have used create-t3-app
  • in the root page I have used api imported from @/trpc/server
  • in the client component I have used api imported from @/trpc/react
Was this page helpful?