DEV Community

Discussion on: Better file structure in React projects

Collapse
 
victorocna profile image
Victor Ocnarescu

Cool structure. I also like to facilitate things using named js exports (in every folder). Everything except the src folder makes perfect sense to me.

Collapse
 
raibtoffoletto profile image
Raí B. Toffoletto

For the /src imagine it as the root for your code. The / is the root of your project, it's a way to separate concerns. Pretty common in other languages... loke having a Main() as an entry point of an application.

Thread Thread
 
victorocna profile image
Victor Ocnarescu

I like the idea of separation of concerns, but I regard the src folder like an API that wraps the response in a "data" object instead of responding with the actual info. I may be wrong though, I see many devs the prefer using the src folder.