Comment by danabramov
5 hours ago
For what it’s worth, the point of React is that you can just fix that Radio component to be an input (if that makes sense) and it’ll just be an input.
React gives you boxes to put stuff into but you decide what to put into them. Then React ensures that you can change what’s in those boxes without breaking anything. That’s the power of component abstraction.
> That’s the power of component abstraction.
Yes. But React isn’t the only way to do components. Unfortunately, to the inexperienced, it is.
What are some much better ways to do components?
React with is so prevalent because it's a deep local optimum.
So is a span or div element? What am I missing here?
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.
1 reply →