~/talk

Enhancing Forms with React Server Components

Talkat React Brussels 2024 · on Friday, 2024-10-18· [react, web-platform]
slides:none on file

Demo uses React 19 server components inside Next.js app router to build a message form that actually submits to the database via a submit message server function (marked with use server and callable as a hidden POST), validates with Zod, revalidates with revalidatePath, enforces a max‑message limit (demo toggles 5 → 8), and progressively enhances with an auto‑scroller client component and useActionState and useFormStatus for pending UI and error handling; optimistic updates use useOptimistic and the form still works with JavaScript disabled.

AI-written summary · about

  1. 0:00Introduction to talk
  2. 2:09React Server Components benefits
  3. 4:56Demo setup and starting point
  4. 5:59Making form interactive with server actions
  5. 8:49Adding automatic scrolling
  6. 9:54Server-side validation with Zod
  7. 12:43Handling server responses with useActionState
  8. 15:38Progressive enhancement without JavaScript
  9. 17:44Testing form without JavaScript
  10. 19:30Creating reusable SubmitButton component
  11. 22:46Optimistic UI with useOptimistic
  12. 24:53Framework comparison 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.