3 ms·
You can use web components in React just fine if that's your cup of tea. https://facebook.github.io/react/docs/web-components.html https://facebook.github.io/r
by danabramov 10y ago
You can use web components in React just fine if that's your cup of tea.
https://facebook.github.io/react/docs/web-components.html https://facebook.github.io/react/docs/web-components.html
There's also more opinionated integrations like https://www.npmjs.com/package/skatejs-react-integration https://www.npmjs.com/package/skatejs-react-integration.
And of course you can do it the other way around too.
- petilon 10y agoThe problem when you use Web Components in JSX is that there is no way to wire up any custom events fired by the Web Component. JSX will only wire up "known events".
- spankalee 10y agoThat's just when you use custom elements in _React_. I've definitely wired up JSX createElement implementations that handle attributes and events properly. My preference is for Polymer-style naming: `on-*` for event handlers, `$` suffix for attributes and everything else is a property. Others who've done this use special `attributes` and `events` properties.