Comment by daveidol
3 hours ago
The parent comment is seemingly blaming React for the decisions of Shadcn for some reason.
There’s nothing about React that requires you to overcomplicate your DOM (unlike many other UI frameworks).
3 hours ago
The parent comment is seemingly blaming React for the decisions of Shadcn for some reason.
There’s nothing about React that requires you to overcomplicate your DOM (unlike many other UI frameworks).
The point I wanted to emphasize is that even if you do overcomplicate your DOM, the component abstraction is what allows you to fix it in one place. Don't like what's in your component — add `return <input />`, bam! It's fixed across the entire app now.
And how is the surrounding JS code, like the event handlers, and the CSS of the component supposed to still work now? A radio input will need at the very least additional CSS to remove the native appearance. Unlikely that was set already --> it's not that easy.
Which also allows to create an overcomplicated jack-of-all-trades component? After all, it's fun and can be justified via the "write once" argument.