React 19s useOptimistic: EVERYTHING you NEED to know @jherr
React 19s useOptimistic: EVERYTHING you NEED to know  @jherr
Uploaded June 2024 | Updated November 2026, 1 day ago
useOptimistic makes your pokey backend feel fast with optimistic updates to your UI. It's simple to use, but we'll covert the gotcha, as well as how to use it with React Query and also whether or not you should use it with a state manager.

Code: github.com/jherr/useOptimistic-video

πŸ‘‰ Upcoming NextJS course: https://pronextjs.dev
πŸ‘‰ Don't forget to subscribe to this channel for more updates: bit.ly/2E7drfJ
πŸ‘‰ Discord server signup: discord.gg/ddMZFtTDa5
πŸ‘‰ VS Code theme and font? Night Wolf [black] and Operator Mono
πŸ‘‰ Terminal Theme and font? oh-my-posh with powerlevel10k_rainbow and SpaceMono NF

00:00 Introduction
00:50 Creating a simple API server
03:05 Setting up Pico CSS
04:40 Connecting to the API server
05:43 Posting todos to the server
06:54 Bring on useOptimistic with 19
09:04 When to call the useOptimistic setter
10:10 useOptimistic with a transition
11:10 Potential issues with useTransition
11:56 Reducer variant of useOptimistic
12:48 Error handling
14:25 Using a form action
16:00 useActionState
17:28 Integrating with React Query
18:02 Don’t fear the peer deps warning
19:48 Using React Query’s useMutation
21:32 Once more, but with Zustand
24:09 State manager or useOptimistic
24:29 Outroduction
React 19s useOptimistic: EVERYTHING you NEED to knowSTOP Using Recoil, Use This Instead!Easily Avoid The #1 Junior Developer Coding MistakeDominik Dorfmeister: React Query With The App RouterGoing To JS Nation AND React Summit!React-Native Server Components! Change Your Native UI From Your Server!Part 2 - MCP Client Setup in 10 MinutesRadix Themes: Awesome New Components For NextJSJunior Devs; Ask For Help The Right Way!The Right Way To Merge JavaScript ObjectsJavaScript Array Immutability CheatsheetNo const! How NOT To Give A JavaScript Talk
Jack Herrington |

React 19's useOptimistic: EVERYTHING you NEED to know

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER