React 19 has brought much better support for writing [[20221024124721-web-components]] within [[react]].
In previous React versions, React treated all unknown properties as attributes. HTML attributes can only have string values, leaving web component authors to use JSON.stringify on more complicated data, or manipulation using the ref directly. You had to write imperative code, rather than declarative React. Thus, wrappers were created to help with translations between React and Web Components.
React 19 fixes this in the following way:
string
, number
, or the value is true
. Props with non-primitive types like object
, symbol
, function
, or value false
will be omitted.https://react.dev/blog/2024/12/05/react-19#support-for-custom-elements https://aleks-elkin.github.io/posts/2024-12-06-react-19/