React 19 Beta – React
May 3, 2024
React 19 adds full support for custom elements and passes all tests on Custom Elements Everywhere.In past versions, using Custom Elements in React has been difficult because React treated unrecognized props as attributes rather than properties. In React 19, we’ve added support for properties that works on the client and during SSR with the following strategy:
Server Side Rendering: props passed to a custom element will render as attributes if their type is a primitive value like string, number, or the value is true. Props with non-primitive types like object, symbol, function, or value false will be omitted.
Client Side Rendering: props that match a property on the Custom Element instance will be assigned as properties, otherwise they will be assigned as attributes.
Source: React 19 Beta – React
We’ve long been fans of Web Components, indeed the first talk on Conffab related to the topic is from 2012 on the Shadow DOM.
“Finally” is overused, but with React 19 we do finally get proper Web Component support.