← Back to context

Comment by danabramov

2 hours ago

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.