DEV Community

Discussion on: Create Reusable Web Components in HTML

Collapse
pjmantoss profile image
PJ Mantoss

Why can't I just use Reactjs for this?

Collapse
bennypowers profile image
Benny Powers 🇮🇱🇨🇦

You can. No one is saying you can't.

bundlephobia.com/result?p=react-do...

But if you do, you'll be shipping 40kb+ of JS over the wire just to do something the browser already comes with built-in.

What's more, "react" usually comes along with a bunch of non-standard extras, and when you inevitably have to rewrite your app down the line for compatibility, you'll be stuck under a mountain of jsx, webpack, and babel cruft.

If you write your app using web components, each element is self-contained and interfaces with the rest of the app using common HTML and DOM. You'll be able to update or change your elements piecemeal, one-by-one. You'll also be able to use your elements across frameworks easily

custom-elements-everywhere.com/

Collapse
pjmantoss profile image
PJ Mantoss

I see!
Thanks