tRPC × Next.js App RouterSource

Full-stack post example

A Server Component reads getLatestPost. The form's Server Action calls createPost, then revalidates getLatestPost.

Latest post
latest post
#0

hello world

Create a post
Works without JavaScript: the form posts to the Server Action.