DEV Community

Discussion on: My secret trick for writing great React components

Collapse
 
victorocna profile image
Victor Ocnarescu

Interesting article. If i understand correctly, Kent would not split a simple component that just contains many many html elements.

I disagree and would split this component right away. The worst case scenario: I have a few extra components included in my main component that are easier to read and have meaningful names.

If I may ask, how large is your largest file on the project you are working on? I am onboarding in a new project where I saw components with over 1000 lines of code. Horror!

Collapse
 
joeattardi profile image
Joe Attardi

A 1,000+ line component sounds like a nightmare, I think that is a perfectly valid reason to break it up :)

Collapse
 
l0st0 profile image
l0st0

I guess you did not see 14000 lines of code :D believe me 1000 is not so bad at all