Skip to content
React Deep Dive: useOptimistic episode artwork

EPISODE · Feb 14, 2024 · 51 MIN

React Deep Dive: useOptimistic

from Frontend First · host Frontend First

Ryan and Sam discuss the purpose and usage of the useOptimistic() hook, a new experimental API from React. Topics include: 0:00 - Intro 2:18 - Problem: RSCs require a server roundtrip before the UI can be updated 10:13 - Solution: useOptimistic() lets you merge ephemeral client-side state with server-side data so you can update the UI during a Server Action or Transition 14:03 - How useOptimistic() avoids the notion of identity by discarding the ephemeral state after the app settles 21:17 - How useOptimistic() lets you safely “fork” state that eventually syncs with the server 27:32 - Handling error states 29:26 - Differences between useOptimistic() and Remix fetchers 34:57 - How useOptimistic() lets you avoid managing a long-lived client-side cache Links: Ryan’s useOptimistic tweet Ryan’s video on React Cache: Part 2

Episode metadata supplied by the publisher feed · Published Feb 14, 2024

Embed this episode

Ryan and Sam discuss the purpose and usage of the useOptimistic() hook, a new experimental API from React.

Distinct summary based on available episode metadata or transcript content.

Ready to play

React Deep Dive: useOptimistic

0:00 51:08

No transcript for this episode yet

We transcribe on demand. Request one and we'll notify you when it's ready — usually under 10 minutes.

No similar episodes found.

No similar podcasts found.

Frequently Asked Questions

How long is this episode of Frontend First?

This episode is 51 minutes long.

When was this Frontend First episode published?

This episode was published on February 14, 2024.

Can I download this Frontend First episode?

Yes. Use the download control on the episode player to save the publisher-provided media file.
URL copied to clipboard!