tRPC × Next.js App RouterSource

RSC + React Query

A Server Component prefetches getLatestPost and hydrates it. The client reads it with useSuspenseQuery and invalidates it after createPost.

Latest post
latest post
#0

hello world

Create a post
Calls createPost, then invalidates getLatestPost.