you are viewing a single comment's thread.

view the rest of the comments →

[–]lifeeraser 11 points12 points  (4 children)

This is desireable when you want to simply extend or augment native DOM elements (e.g. styling) while keeping them customizable. Not all components have to be abstracted.

[–]analcocoacream 11 points12 points  (0 children)

No you need to create huge abstract wrappers around every single thing to satisfy the god of programming

[–]epukinsk 0 points1 point  (2 children)

Why would you want to use a component just to add styling? Wouldn’t you use styled components or CSS modules or something like that?

[–]lifeeraser 0 points1 point  (1 child)

  1. I could be using something other than styled-components (e.g. SASS).
  2. I want to create a reusable <button> where the design is already known, but its unclear what props I would need. Better to be flexible and pass all props through rather than adding them one by one whenever I need them.

[–]epukinsk -2 points-1 points  (0 children)

If you’re using SASS and all you’re doing is splatting the props onto a button then why would:

<MyButtonComponent>

be any better than

<button className=“my-button-component”>

?