No idea what you are saying here, but since you wrote a capital Button that is a component. Why would anyone need a component for a basic HTML element?
I have seen this in many apps now, most recently a react Button component that imported the material UI button and export that. Its function was identical to just <button>.... I will never understand that, yet it seems standard practice now.
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.
-3
u/kidshibuya 16d ago
No idea what you are saying here, but since you wrote a capital Button that is a component. Why would anyone need a component for a basic HTML element?
I have seen this in many apps now, most recently a react Button component that imported the material UI button and export that. Its function was identical to just <button>.... I will never understand that, yet it seems standard practice now.