React 19 brings async functions, server components/actions and support for custom elements
The Meta team has announced the release of React 19, introducing several significant new features and enhancements. One of the key updates is the support for using async functions in transitions, simplifying the handling of pending states, errors, forms, and optimistic updates. This is complemented by the introduction of useOptimistic
and a new hook, React.useActionState
, to streamline common cases for Actions.
React 19 also integrates Actions with new `` features in react-dom
, offering a useFormStatus
hook that allows reading the status of the parent form as if it were a Context provider. A new API, use
, has been introduced to facilitate reading resources during rendering. For static site generation, react-dom/static
now includes prerender
and prerenderToNodeStream
APIs.
Server Components and Actions are now part of React 19, enabling pre-rendering of components and allowing Client Components to execute async functions on the server. Additionally, function components can now access ref
as a prop. Error reporting has been enhanced, particularly for hydration errors in react-dom
.
React 19 brings full support for custom elements, passing all tests on Custom Elements Everywhere. Other features include the introduction of `` as a provider, support for returning cleanup functions from ref
callbacks, native rendering of document metadata tags, async scripts, resource preloading, and improved error reporting.