5 ms·
It is actually not "done better". Web Components have shadow DOM, which permits scoped CSS. React Components are brittle because styles and scripts are global.
by interlocutor 10y ago
It is actually not "done better". Web Components have shadow DOM, which permits scoped CSS. React Components are brittle because styles and scripts are global. Also, some people think you can only pass strings as attributes to Web Components. This is not true; you can pass objects just like in React. Also, Web Components are declarative not imperative, again like React.
- lostPixels 10y agoYes but you didn't dispute his major point of server-side rendering.
- interlocutor 10y agoYou can uses this to do server-side rendering: https://github.com/pimterry/server-components https://github.com/pimterry/server-components
- wwalser 10y agoI didn't mean "done better" as an absolutist statement, but I can understand why it would be read that way. I meant it more as a brand statement, obviously the React team, contributors and users are likely to believe it's better. I get that some will come down on the other side of that coin. I stand by the statement that the competition between these two projects is good for the web which I think is the important part of my response to the parent comment. I'm glad there are people working with and on web components.
- interlocutor 10y agoWhat is the point of open standards if everyone competes against the open standard as opposed to supporting the standard?
- wwalser 10y agoFacebook isn't "everyone". As I noted in the comment to which you're replying, there are people building and using Web Components. Nothing about Facebook creating React prevents browser vendors from implementing Web Components natively. React uses other open standards (ECMA & HTML) which have existed for a decade previous to Web Components. Web Components contains good ideas. React contains good ideas. You're arguing against people who are helping. Stop doing that.
- interlocutor 10y agoSomehow I think the reaction would be different if Microsoft had done this, i.e., make proprietary competing technology instead of supporting an open standard. (Yes, React is proprietary--look into the patent rider issue.)