~/talk

Enhancing Forms with React Server Components and React 19

Talkat React Alicante 2024 · 2024-09-19..09-21· [react, typescript]
slides:none on file

Demo builds a live form using React 19 server components inside Next.js app router with Prisma, Zod and Tailwind, showing server actions wired to the extended form element, automatic scrolling via a tiny client component, and real backend validation with a hard max message count (5 then tested to 8). It uses useActionState and useFormStatus to show pending and errors, implements useOptimistic for immediate UI updates, revalidates with revalidatePath, and works without JavaScript.

AI-written summary · about

  1. 0:00React Server Components intro
  2. 2:15React 19 form features
  3. 5:27Setting up the demo environment
  4. 6:32Server action for submission
  5. 9:24Auto-scroll form
  6. 10:29Zod validation
  7. 13:40useActionState feedback
  8. 15:08Toast for errors
  9. 16:30Prevent form reset
  10. 17:13Pending states with useActionState
  11. 18:42Progressive enhancement
  12. 19:45Reusable SubmitButton
  13. 22:13Reset messages server action
  14. 23:35Optimistic UI updates
  15. 25:41Summary
~/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.