diff --git a/src/content/blog/2024/04/01/react-19.md b/src/content/blog/2024/04/01/react-19.md index bb2c94db5..de668a915 100644 --- a/src/content/blog/2024/04/01/react-19.md +++ b/src/content/blog/2024/04/01/react-19.md @@ -673,7 +673,15 @@ For more info and examples, see the docs for [`createRoot`](/reference/react-dom ### Custom Element Support {/*support-for-web-components*/} -TODO +Custom Elements have been part of the web platform for a long while now however using them with React has been impractical because React has always treated unrecognized props as attributes rather than properties. + +React 19 adds support for custom elements and passes all tests on [Custom Elements Everywhere](https://custom-elements-everywhere.com/) + +During Server Side Rendering props passed to a custom element will render as attributes if their type is a `"string"`, `"number"`, or the value is `true`. props with type `"object"`, `"symbol"`, `"function"`, or value `false` will be omitted. + +During 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. + +Thanks [Joey Arhar](https://github.com/josepharhar) for driving the design and implementation of Custom Element support in React. #### How to Upgrade {/*how-to-upgrade*/}