Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

I guess because React insists on going against WebComponents, while everyone else is adopting them.

At least that is my understanding from Angular, Vue, Ionic, Svelte and plain VanilaJS point of view.



React can be used with web components if you want.

https://reactjs.org/docs/web-components.html

The big issue is browser support. According to caniuse, IE and Edge simply have zero support while Opera and Safari have only partial compliance. The current Firefox ESR doesn't support it either (behind a flag).

The polyfill incurs a big performance hit and a lot of devs need to support those browsers for several more years.


Edge support is perfectly fine, and it is going to be replaced by Chrome anyway.

Firefox, Safari and Chrome based browsers are perfectly fine.

Opera is based on Bink nowadays.

ESR is not something that I regularly see in the wild.

In any case, I was speaking that only see this anti-WebComponents attitude in the React community.


Safari doesn't support customized built-in elements, at all, and isn't going to. That is pretty far from being "perfectly fine".


I see all green here.

https://www.webcomponents.org/


https://caniuse.com/#search=web%20components

The Shadow DOM and Custom Elements are not that kind of green it should be.


That's silly, customized built-ins are not an essential feature. They are a nice to have. You can get by without ever using them, which is indeed what most people do. As does the subject of this discuss, the Lightning Web Components doesn't use that feature at all.


It also means, that you cannot use existing form controls for your custom element, you must build them up from scratch from divs, and relegate them into uncanny valley of not-quite-native, slightly-off elements.

Yes, it is possible to not use them; you can always make your life harder than necessary, you could also write an modern OS in assembly, for example, if you wanted to. If people are avoiding them today, one reason could be that they want their components to run in Safari.


Even if you aren't able to inherit from a form element, can't you still `createElement` one and add it inside your custom element? Surely they don't force you to reimplement <input /> from scratch!


Yes, you can compose them; and then implement a proxy that creates all the methods and attributes that given element class is supposed to have and forward them to the real implementation.

Busywork, so Apple can hold their position. How nice. No, it is not "perfectly fine".




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: