Loading tutorials
useState, props, async/await, and how to send data to a server with fetch or a server function. It covers the React 19 mechanism that useOptimistic depends on. The hook itself comes in the next chapter. Here you learn what an Action 5 min readuseState, props, async/await, and how to submit data from a React component. It also assumes you know the basic shape of useOptimistic and that its setter runs inside an Action, such as a form action or startTransition.6 min readuseState, props, async/await, and the basic useOptimistic call from earlier chapters. It covers what happens after you call the optimistic setter: when React shows the optimistic value, when it discards it, and what you must do so that the swap to real state loo6 min readuseState, props, and async/await. It also assumes you have seen the basic useOptimistic signature: const [optimisticState, setOptimistic] = useOptimistic(state, updateFn). You should know that React 19 runs asynchronous work inside Actions. Here you will see w6 min readuseState, props, and async/await. It also assumes you have read the earlier chapters on the useOptimistic update function, the automatic revert, and form actions. Here you will learn how to show users which list items are still unconfirmed.6 min readuseOptimistic and the update function work, how a form action runs inside a transition, and how React uses key to match list items between renders. You should also be comfortable with async/await.6 min readuseOptimistic does when several optimistic updates overlap, and how to write code that stays correct in that case.8 min readuseOptimistic derives a temporary value from real state. You should also know that React discards that value when the Action finishes, and how to show an error after a failed request. Here you7 min read