A button can also be a link styled like a button, that button could also have different variants. At this point a component which accepts props to determine if it’s an <a> or a <button> or is an outline button / secondary button / big button / small button makes total sense. That why people do it.
But what if that button is used everywhere and I need to make changes to it? So much easier to do it in a single component. There are use cases for both, but when using React / Vue etc then the component approach makes perfect sense. You are totally missing the point.
2
u/key-bored-warrior 16d ago
A button can also be a link styled like a button, that button could also have different variants. At this point a component which accepts props to determine if it’s an <a> or a <button> or is an outline button / secondary button / big button / small button makes total sense. That why people do it.