Dev News: React 19 Beta and Redwood Tests React Server Components

React 19 beta released Thursday and it includes all of the React Server Components features from the canary channel.
New features in this beta include:
- Actions. “In React 19, we’re adding support for using async functions in transitions to handle pending states, errors, forms, and optimistic updates automatically,” the team stated in a blog post about the React 19 beta.
- New hook: useActionState. This was added “to make the common cases easier for Actions,” the team wrote.
- React DOM <form> Actions. Actions are integrated with React 19’s new <form> features for react-dom.
- React DOM: New hook: useFormStatus, which makes it easier to write design components that need access to information about the <form> they’re in, without drilling props down to the component.
- New hook: useOptimistic. “Another common UI pattern when performing a data mutation is to show the final state optimistically while the async request is underway,” the team wrote. “In React 19, we’re adding a new hook called useOptimistic to make this easier.”
- New API: use. There’s a new API to read resources in render: use. This can be used to read a promise, which React will suspend until the promise resolves.
The team also explained a bit more about React Server Components. They are a new option the “allows rendering components ahead of time, before bundling, in an environment separate from your client or SSR server,” the team wrote. The separate environment is the “server” and server components can run once at build time on a CI server or they can be run for each request using a web server, the team explained.
“This means libraries that ship with Server Components can now target React 19 as a peer dependency with a react-server export condition for use in frameworks that support the Full-stack React Architecture,” the team noted.
While React Server Components are stable and won’t break between major visions, alas the underlying API used to implement the components bundler or framework “do not follow server and may break between minors in React 19.x,” the team wrote.
“To support React Server Components as a bundler or framework, we recommend pinning to a specific React version, or using the Canary release,” the blog post about the release stated. “We will continue working with bundlers and frameworks to stabilize the APIs used to implement React Server Components in the future.”