DEV Community

Discussion on: React long Components

shiftyp profile image
Ryan Lynch (he/him)

I didn't see the links in your post! So here's what I would say briefly. If you look at react select for example:

  • Dependencies: This component has very few dependencies
  • Logical Weight: This single component lifts a lot of logical weight, and I see methods and things that could be standalone functions or components.
  • Abstraction: This is heavy on abstraction (it defines a component class, which is a huge abstraction), but the use of TypeScript puts more of that machinery in code.

Would I break this up into more modules? I think that would depend on the time available, but ideally I think it could have more dependencies at the benefit of being less individually complex in my opinion. Hope that helps!