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 - Intro2:18 - Problem: RSCs require a server roundtrip before the UI can be updated10: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 Transition14:03 - How useOptimistic() avoids the notion of identity by discarding the ephemeral state after the app settles21:17 - How useOptimistic() lets you safely “fork” state that eventually syncs with the server27:32 - Handling error states29:26 - Differences between useOptimistic() and Remix fetchers34:57 - How useOptimistic() lets you avoid managing a long-lived client-side cacheLinks:Ryan’s useOptimistic tweetRyan’s video on React Cache: Part 2
What this episode covers
Ryan and Sam discuss the purpose and usage of the useOptimistic() hook, a new experimental API from React.
NOW PLAYING
React Deep Dive: useOptimistic
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