3 ms·
You can totally write web components with Preact: https://preactjs.com/guide/v10/web-components/ https://preactjs.com/guide/v10/web-components/ From a quick sk
by rictic 5y ago
You can totally write web components with Preact: https://preactjs.com/guide/v10/web-components/ https://preactjs.com/guide/v10/web-components/
From a quick skim of their docs, it looks like AMP still uses web components.
The nice part about web components is that the users of a library don't have to care about how it's implemented, so switching to preact is a transparent change.
- cageface 5y agoReact still doesn't play seamlessly with WC right?
- jpangs88 5y agoIt seems to work okay as in you can use them: https://reactjs.org/docs/web-components.html https://reactjs.org/docs/web-components.html But it is not fully integrated with react, you have to do some work for interaction: https://www.sitepen.com/blog/wrapping-web-components-with-react https://www.sitepen.com/blog/wrapping-web-components-with-re... That link is a few years old though I think the principle is the same.
- e111077 5y agoThis site tells you which frameworks work well with custom elements. And if they play well with custom elements, then they're usually fine with web components https://custom-elements-everywhere.com/#preact https://custom-elements-everywhere.com/#preact