React can't create custom elements or extend the built in ones. React, as an abstraction layer can of course handle their components, but they're just logical containers that render html elements. Web components are THE html elements you should render inside react, as for the built in ones.
You can use react fully, but you will have the react dependency. Wc are framework agnostic with no dependencies if you use vanilla js. With react you can't create or extend native html elements, (this is the point of web components) you can just use then the html elements you have and combine them to build a new widget. While with web components you can't build apps or complex things because you work directly with the platform api. They are on a different abstraction layer, as I said here:
I think that's a very good point; the abstraction layer. The link above puts it well:
We are told web components are basically new HTML elements, so we should consider them as part of the HTML specifications and, consequently, we should follow its paradigms, core concepts, and utilization. If we assume all of these points, we will figure out that our components will live among the lowest levels of the web platform stack, alongside HTML, CSS, and JavaScript.
Web Components seem to be at the leaf level of HTML documents. I don't feel comfortable when folks say that an entire SPA should be enclosed in a single Web Component.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
React can't create custom elements or extend the built in ones. React, as an abstraction layer can of course handle their components, but they're just logical containers that render html elements. Web components are THE html elements you should render inside react, as for the built in ones.
So I could argue both ways.
Why then not use react fully? Or why not use web components fully?
You can use react fully, but you will have the react dependency. Wc are framework agnostic with no dependencies if you use vanilla js. With react you can't create or extend native html elements, (this is the point of web components) you can just use then the html elements you have and combine them to build a new widget. While with web components you can't build apps or complex things because you work directly with the platform api. They are on a different abstraction layer, as I said here:
css-tricks.com/making-web-componen...
Okay, thanks for the link!
I will read it!
I think that's a very good point; the abstraction layer. The link above puts it well:
Web Components seem to be at the leaf level of HTML documents. I don't feel comfortable when folks say that an entire SPA should be enclosed in a single Web Component.