Menu

Post image 1
Post image 2
1 / 2
0

My React Folder Structure (Opinionated but Works)

DEV Community·Sohana Akbar·about 1 month ago
#jXJL0Wxc
Reading 0:00
15s threshold

TL;DR: Stop throwing everything into components/. After 6 production apps and 3 burned-out refactors, I landed on a feature-based, domain-driven structure that scales from 1 to 100 components. I have tried every structure: grouped by type, grouped by route, atomic design, and even "just throw it in src." This is the one that finally made me stop crying during code reviews. The Golden Rule: Co-location of Concern "Files that change together, live together." If you are editing UserProfile.tsx and you have to jump to 4 different folders (components/, hooks/, types/, services/), your structure is broken.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More