DEV Community

Discussion on: My secret trick for writing great React components

Collapse
 
edpe profile image
Ed Perkins • Edited

It's a nice idea, but wading through a million nested components is a debugging nightmare and makes the context of each component difficult to understand for someone who is new to the project.

I always prefer to abstract when I need to rather than adhere to the single responsibility principle. I'm not convinced that universal rules are necessarily always useful.

Collapse
 
victorocna profile image
Victor Ocnarescu

I was not convinced at first as well, but I found out over and over again that if it's easier to read it has less bugs.

I'm curios about the abstraxtion you were referring. Could you give me an example?