Member-only story
How You Should Structure Your React Applications
A matter of taste, sure, but here is an approach that scales
Is there a perfect method for structuring a React project? The official documentation won’t help you much. React is a library and not a framework, which is why it doesn’t have opinions on how you should build your app.
This is nice because it gives us the freedom to structure our app as we want. Experienced developers won’t find a disadvantage to this, but junior developers might find it difficult to find a way to build a neat structure.
My Philosophy
Each project answers a specific need and therefore needs a specific structure and rules. There are as many bad ways as there are good ways of structuring your app. The approach I will describe in this article might not be the perfect answer to your project’s specific needs.
With that said, I’ve been working with React for a while on projects of different sizes. The structure I’m using today is really different from the one I was using a few years ago. Indeed, I’ve been improving my way of structuring an app for every project I’ve created. Since I’m pretty happy with the structure I’m using these days, I decided to share it.