EPISODE · Nov 14, 2024 · 59 MIN
Exploring useActionState
from Frontend First · host Frontend First
Sam and Ryan talk about React 19's useActionState hook. They discuss how adding async functions to a plain React app introduces lots of in-between states that developers must grapple with, and how useActionState allows React to collapse and eliminate these states, bringing the simplicity of React's sync mental model to our async code.Timestamps:0:00 - Intro1:51 - How React normally eliminates state in synchronous apps8:20 - How useActionState lets React eliminate state in asynchronous apps18:17 - Why you shouldn't just pass server actions into useActionState23:00 - TCP/IP and UDP analogy26:39 - Thinking of useActionState like enqueue34:55 - Why the term "reducer" is too loaded for best understanding useActionState51:07 - How useActionState helps you build a Todo app that stays responsive during pending actions
What this episode covers
Sam and Ryan talk about React 19's useActionState hook. They discuss how adding async functions to a plain React app introduces lots of in-between states that developers must grapple with, and how useActionState allows React to collapse and eliminate these states, bringing the simplicity of React's sync mental model to our async code.
NOW PLAYING
Exploring useActionState
No transcript for this episode yet
Similar Episodes
Sep 26, 2023 ·65m
Sep 26, 2023 ·66m
Sep 26, 2023 ·69m
Sep 26, 2023 ·64m
Sep 26, 2023 ·66m
Sep 26, 2023 ·61m