In this recipe, we will learn how to structure our project in a better way.
Organizing our React application
How to do it...
We can create React components with the default structure that create-react-app provides, but in this recipe, I'll show you a better way to organize the project so that we are ready when for when the application grows.
- We need to create a new React app (check the last recipe if you haven't created a React app yet)
- Currently, our React application directory tree looks like this:
![](https://static.packt-cdn.com/products/9781783980727/graphics/assets/92e8684d-42cf-416f-a60a-5afcff61c84b.png)
- We need to create src/components and src/shared directories
- After this, we need to create the src/components/Home directory for our component and move Home.js into this folder
- The App.js file stays...