Skip to main content

A quick glance at the React 19 Beta feature set

3 min read

The React 19 Beta release is out and the accompanying blog post is a great read. Here's a quick glance at the new features and improvements that are part of this release.

  • Some spicy new hooks and a concept of async functions being "actions"
  • The use function - new API to read resources in render. Which is named like a hook but doesn't have the same conditional code issue hooks have, you can give it promises and contexts according to the post. Confusing at first glance, maybe it'll settle over time.
  • Server components and actions continue to be a thing
  • Goodbye forwardRef, just use ref directly in props now as the second param.
  • Goodbye Context.Provider, you just use <Context> as the provider now
  • ref callbacks get a cleanup callback like effects
  • Goodbye react-helmet - React now handles HTML metadata and hoists it into the head from any component
  • Stylesheet links and <style> tags now available - How was this not a thing before? 🤯
  • New resource preloading APIs
  • Better handling of async script tags
  • Better error reporting
  • Web Components enter the arena with React19 now supporting Custom Elements

Insight: A common misunderstanding is that Server Components are denoted by "use server", but there is no directive for Server Components. The "use server" directive is used for Server Actions.

I think this was an easy misunderstanding to make, so I'm glad for the clarification.

This is a pretty exciting release, given the last significant release from React was March 29, 2022. The wheels are moving again!

React continues to evolve and solve a combination of new problems while fixing some of the pain points with nice quality of life improvements.

I do get the feeling that with the introduction of Server Components, the mental model of React now becomes dynamic and more complicated depending on your use case, maybe that will prove out in time as frameworks adopt it and provide opinionated workflows around it.

I'm keeping an eye on the other frameworks/libraries maturing in the space like Svelte, SolidJS, Vue, AlpineJS to see how the new React features measure up, and I might be back with a comparison post in the future.

© 2021 by Madole.
GitHub Repository
Last build: 1718543671768