React 19 beta is out, promising stable server components and a host of other developments

React 19 beta is out, promising stable server components and a host of other developments

Meta’s React team has released React 19 beta with fresh features including a “use” API, Actions with new hooks, stable Server Components, Server Actions and more.

This will be the first major release for more than two years, following React 18 which was made generally available in March 2022.

A major feature which has been in development for several years is server components, designated experimental when React 18 was released and remaining so through to version 18.2 in June 2022. Despite this status, server components are part of Vercel’s Next.js, a framework built on React which has a special status. Most members of the current React core team are from Meta, but four are Vercel engineers; no other company is similarly represented.

In React 19, according to the introductory post, “React Server Components … are stable and will not break between major versions.” The caveat is that underlying APIs used “may break between minors in React 19.x”, meaning that bundlers or frameworks supporting them should pin to a specific version. The React team still refers to “frameworks that support the Full-stack React Architecture”, which is at the time of writing only Next.js.

React 19 also includes Actions, with the post stating that “by convention, functions that use async transitions are called ‘Actions’”. Actions manage submitting data, via forms or other methods, and in React 19 have a useOptimistic hook which lets developers show the final state optimistically while a request is in progress, and update it when the request finishes.

A new “use” API can read the value of a resource such as a promise or context. 

React 19 has numerous other new features, including improved error reporting, native support for metadata tabs in components, deep integration with CSS (stylesheets) for both client and server-side rendering, and better support for async scripts.

In order to assist with migration to React 19, the team has also released version 18.3, described as “identical to 18.2 but adds warnings for deprecated APIs and other changes that are needed for React 19.”

React is an important framework both for its concepts and as the basis for other frameworks including Next.js, Gatsby, Vite, Redux, Remix.js and more. It is complex though, and with the addition server components is now a hybrid framework as opposed to only taking a client-centric approach.