DEV Community

Discussion on: How I structure my React projects

Collapse
 
lesleyvdp profile image
Lesley van der Pol

Interesting structure! I also use something similar to this, but it always gets a little questionable once a project grows. What does your structure evolve into when you have component A, and component A has custom styles, hooks, utils and tests?

Collapse
 
larswaechter profile image
Lars Wächter

In this case I would put all the files that belong to the component into one directory. So something like this:

├── components
│   ├── User
│   │   │── Card
│   │   │   ├── Card.css
│   │   │   └── index.js
│   │   │   └── test.js
│   │   │   └── useCard.js
Enter fullscreen mode Exit fullscreen mode