On The Bike Shed, hosts Joël Quenneville and Stephanie Minn discuss development experiences and challenges at thoughtbot with Ruby, Rails, JavaScript, and whatever else is drawing their attention, admiration, or ire this week.
…
continue reading
内容由Frontend First, Sam Selikoff, and Ryan Toronto提供。所有播客内容(包括剧集、图形和播客描述)均由 Frontend First, Sam Selikoff, and Ryan Toronto 或其播客平台合作伙伴直接上传和提供。如果您认为有人在未经您许可的情况下使用您的受版权保护的作品,您可以按照此处概述的流程进行操作https://zh.player.fm/legal。
Player FM -播客应用
使用Player FM应用程序离线!
使用Player FM应用程序离线!
React Deep Dive: useOptimistic
Manage episode 400981458 series 1635850
内容由Frontend First, Sam Selikoff, and Ryan Toronto提供。所有播客内容(包括剧集、图形和播客描述)均由 Frontend First, Sam Selikoff, and Ryan Toronto 或其播客平台合作伙伴直接上传和提供。如果您认为有人在未经您许可的情况下使用您的受版权保护的作品,您可以按照此处概述的流程进行操作https://zh.player.fm/legal。
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:
201集单集
Manage episode 400981458 series 1635850
内容由Frontend First, Sam Selikoff, and Ryan Toronto提供。所有播客内容(包括剧集、图形和播客描述)均由 Frontend First, Sam Selikoff, and Ryan Toronto 或其播客平台合作伙伴直接上传和提供。如果您认为有人在未经您许可的情况下使用您的受版权保护的作品,您可以按照此处概述的流程进行操作https://zh.player.fm/legal。
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:
201集单集
所有剧集
×欢迎使用Player FM
Player FM正在网上搜索高质量的播客,以便您现在享受。它是最好的播客应用程序,适用于安卓、iPhone和网络。注册以跨设备同步订阅。