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

Something so simple such as this doesn’t even need a library, you can just use Web Components. Simple components are not why people use React.


Web Components are anything but simple, are cumbersome and inconvenient, and have even more footguns than the already footgun-y React.

Even if you only mean "custom elements" instead of "Web Components" (which "custom elements" are part of) they are still absurdly complex for what they do: how is it simple that instead of just having properties you have attributes AND properties, which are completely different things even though you'd expect them to serve the same purpose, and now you're in charge of syncing them!?

I'm trying to get away from the imperative DOM, not create even more quirks and footguns for my consumers!

They're not even meant to replace React. Web Components don't do templating. You can perfectly build Web Components with React since a Web Component is not concerned with rendering at all. If anything they are a replacement for jQuery-based "component"-wrappers (which were already replaced long ago... by React completely changing the frontend paradigm).

And they are client-side only. By design. They don't and will never work with JS disabled. Rendering a custom tag server-side just sends that custom tag over the wire... and there you can only send attributes (which are string-only) so good luck with complex stuff like a huge datatable.

You can tell they were designed by committee because they solve problems from 15 years ago in a worse way than the SotA.




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

Search: