DiscoverFrontend FirstExploring useActionState
Exploring useActionState

Exploring useActionState

Update: 2024-11-14
Share

Description

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 - Intro
  • 1:51 - How React normally eliminates state in synchronous apps
  • 8:20 - How useActionState lets React eliminate state in asynchronous apps
  • 18:17 - Why you shouldn't just pass server actions into useActionState
  • 23:00 - TCP/IP and UDP analogy
  • 26:39 - Thinking of useActionState like enqueue
  • 34:55 - Why the term "reducer" is too loaded for best understanding useActionState
  • 51:07 - How useActionState helps you build a Todo app that stays responsive during pending actions
Comments 
00:00
00:00
x

0.5x

0.8x

1.0x

1.25x

1.5x

2.0x

3.0x

Sleep Timer

Off

End of Episode

5 Minutes

10 Minutes

15 Minutes

30 Minutes

45 Minutes

60 Minutes

120 Minutes

Exploring useActionState

Exploring useActionState

Frontend First