~/talk

Enhancing Forms with React Server Components

Talkat React Conf 2024 · 2024-05-15..05-16· [react]
links:none on file
slides:none on file

Builds a chat-style form using Next.js App Router with React Server Components, Prisma + SQLite and Tailwind, and shows a concrete workflow: a server action (use server) receives FormData, validates with Zod, inserts to the database, calls revalidatePath, and a client-only automatic scroller (MutationObserver) wraps server-rendered messages. Uses useActionState for server-returned state and pending flag, demonstrates optimistic updates with useOptimistic and automatic rollback on mismatch, enforces a message limit (5→8 in demo) and shows the form still works without JavaScript.

AI-written summary · about

  1. 0:00Introduction and setup
  2. 1:27Enhancing form with server actions
  3. 4:36Adding validation and error handling
  4. 9:11Progressive enhancement with useActionState
  5. 15:50Testing without JavaScript
  6. 16:54Progressive enhancement benefits
  7. 17:37Optimistic UI updates demo
  8. 20:13Q&A and conclusion
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.