Untitled

If you are reading this, you probably know what React.js is and might have already used it Earlier. However, you might be wondering why I am reading about folder structure?

Can’t I just stuff all my files in the src folder?? 🤪

Technically you could do that and React.js will take care of everything. But as soon as your project becomes larger, it will become hard for you to maintain your files and debug them. Also if you are going to work in a team for your team members, it's very difficult to grasp your code.

So there must be a perfect folder structure to keep your src folder clean.

<aside> 💡 ReactJs is a frontend library for building User Interfaces.

</aside>

React is all about Components!

Components are like JavaScript functions. Every application which we will develop in react will be made up of pieces called components. Components make the task of building UIs much easier.

Actually, entire UIs broke down into multiple individual pieces that are components and then work on them independently and merge them all in a parent component which will be the final UI.

In this section, we will cover only the directory structure of the React.js application.

So let's begin..... 🤩

Open your terminal

React Installation

Run the code

npm i -g create-react-app

npx create-react-app my-app-name

This will create a template React.js app that we can modify to make it our own.

After installing react node_modules will be automatically installed as shown below.

33.png