~/talk

Enhancing Forms with React Server Components

Talkat React and Chill 2024 · on Thursday, 2024-08-22· [react]
slides:none on file

Shows how React Server Components plus Next.js app router and React 19 features turn a plain message form into a low-JS, server-driven UX: uses server actions and the extended form component to post FormData directly to a Prisma-backed DB, enforces a max messages per user (demo uses 5 then tests at 8), and implements progressive enhancement so the form works with no JS. Adds client interactivity with a tiny automatic scroller, uses useActionState, useFormStatus to show pending/error states, and useOptimistic for instant updates that roll back on server rejection.

AI-written summary · about

  1. 0:00Intro
  2. 0:30Problems with single page applications
  3. 2:03React Server Components
  4. 5:16Demo
  5. 6:20Server Components
  6. 10:05Automatic Scrolling
  7. 12:26Error Boundary
  8. 14:49UseActionState
  9. 22:19Submit Button
~/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.