DEV Community

Discussion on: Better file structure in React projects

Collapse
 
victorocna profile image
Victor Ocnarescu

Sure, it makes sense to expand and nest some folders when the project grows in size. But I have seen some small projects with many levels of unnecesary nesting.

From what point onward would you consider a project large?

Collapse
 
gdenn profile image
Dennis Groß (he/him)

I agree many projects have very complicated folder nesting without clear purpose.

I would consider a React project in particular already large when you have > 40 components. But that's highly subjective. That's the threshold around which I would consider a nested folder structure.

But the nested folder structure must not be implemented everywhere. Some projects have a lot of components but not so many pages or services...

I guess keeping it practical is the best advice you can give someone here.

Thread Thread
 
victorocna profile image
Victor Ocnarescu

Keeping it practical and starting simple is great advice!