mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-23 20:23:08 +00:00
add custom element section
This commit is contained in:
@@ -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*/}
|
||||
|
||||
Reference in New Issue
Block a user