DEV Community


Discussion on: Angular - How many components is too many components?

flexdinesh profile image
Dinesh Pandiyan

I think it all comes down to reusability.

IMO, if you think a piece of code doesn't have any value standing on its own, then it doesn't need to be a component (arguably).

Input could be a component when

  1. You could style your input the way you need and reuse it throughout your code.
  2. You compose your input with validation or any other functional need and expose it as a single reusable component.

Input need not be a component when
You don't have the need to reuse it and will probably need it only once in your code (very unlikely scenario for input but you get the point).

I would suggest breaking down your code into as many components as possible because it will make your code look clean and readable but at the same time over componentizing everything is not recommended.