SPAs in React 19
July 11th, 2024//Ep. 189
Sam and Ryan discuss the new features in React 19 that will specifically benefit developers building single-page applications. They talk about how Suspense and Transitions let developers "teach" React about when their apps are in a loading or a pending state, how Client Actions improve upon using events in React 18 to handle data mutations, and how Actions enable React Components to automatically render and discard optimistic updates without any knowledge of the application's data layer. They also discuss several new Hooks like useOptimistic, useFormStatus, useActionState, and useOptimistic.
Timestamps
- Intro
- How SPAs are built in React 18
- How Suspense made loading a first-class concept in React
- The problem with data writes in React 18
- What are Client Actions?
- What does it look like to use Actions?
- What are the benefits of Actions?
- How does React 19 change the Optimistic UI story?
- Working with Transitions outside of Actions
- The useActionState Hook
- Using Transitions to keep the old UI rendered and responsive
- How Transitions enable better composition patterns in third-party libraries
- Building a SortableList that flips between being controlled and uncontrolled