DEV Community

Play With Codes
Play With Codes

Posted on • Edited on

How Does Create React App Work?

Create React App is a standalone tool that can be run using either npm or Yarn.

You can generate and run a new project using npm just with a couple of commands:

npx create-react-app new-app
cd new-app
npm start
Enter fullscreen mode Exit fullscreen mode

If you prefer Yarn, you can do it like this:

yarn create react-app new-app
cd new app
yarn start
Enter fullscreen mode Exit fullscreen mode

Create React App will set up the following project structure:

new-app
├── .gitignore
├── node_modules
├── package.json
├── public
│   ├── favicon.ico
│   ├── index.html
│   ├── logo192.png
│   ├── logo512.png
│   ├── manifest.json
│   └── robots.txt
├── README.md
├── src
│   ├── App.css
│   ├── App.js
│   ├── App.test.js
│   ├── index.css
│   ├── index.js
│   ├── logo.svg
│   ├── reportWebVitals.js
│   └── setupTests.js
└── yarn.lock
Enter fullscreen mode Exit fullscreen mode

It will also add a react-scripts package to your project that will contain all of the configurations and build scripts. In other words, your project depends on react-scripts, not on create-react-app itself. Once the installation is complete, you can fire up the dev server and start working on your project.

Read Full Article from SitePoint.
Must Look At: Best Web Hosting Black Friday Deals 2021

Top comments (0)