invalidate data fetched from server component
Using server components, imagine you have awated some data from an api and down the road you have mutate this data, is there any way that you can mutate it like has been doing in react-query when we
queryClient.invalidteQueries()
7 Replies
Data Fetching: Server Actions and Mutations | Next.js
Learn how to handle form submissions and data mutations with Next.js.
Optimistic updates
Thanks bro
👍
One last thing I am using trpc is there anything special about it for revalidating data
Or it is the same ?
I am fetch from server components but mutate from a client component
it doesn't seem that I can tag a request made with TRPC
you would use this
Optimistic Updates | TanStack Query React Docs
React Query provides two ways to optimistically update your UI before a mutation has completed. You can either use the onMutate option to update your cache directly, or leverage the returned variables to update your UI from the useMutation result.
Via the UI