DEV Community

Discussion on: What makes you think "Ok, that should be a component"?

Collapse
 
vtrpldn profile image
Vitor Paladini

I usually create components when at least one of the following apply:

  1. I'm implementing a component already described in a style guide
  2. The particular piece of code is complex and might make the current page/section code needlessly confusing
  3. I've already implemented similar logic before, so I wrap both implementations in a single component IF doing so makes the code easier to understand