What is created with create-react-app?

ham_codes
2 min readFeb 7, 2021

--

When I first starting learning React I was a little taken back by how many things came with the bare bones app created by create-react-app. When I would open up my project directory and take a look, I started to wonder what I really needed versus what wasn’t necessary and could be deleted. I’m going to dive into this a little bit and see what’s there to start off with.

In my project directory when first created, I see the following files:

src, public, node_modules, package.json, package-lock.json, readme.md. What are all of these and what do they do? In simple terms they can be broken down like this:

The src folder is where we put all the source code that we will be writing for our application.

The public folder is where all of our static files like images are stored.

Node_modules is a folder that contains all the project dependencies that our application needs to work properly.

Package.json configures our project and records our project dependencies.

Package-lock.json records the version of packages that are installed in our application.

The readme.md is a file that contains instructions on how to use the project or application we have created.

This was a simple overview of the files that I first see within my application. Now onto what is inside our src folder and what I usually keep versus delete.

In order to create a fresh application for myself, I tend to delete all of the files within this folder with the exception of index.js. In order to make sure my project is still running, I make sure of three things within this index.js file. I import react and reactDOM, create a react component and I take the react component and show it on the screen. This was a very brief introduction to create-react-app and in future posts I will dive into this a little deeper. Thanks for reading!

--

--

No responses yet