#AD 50 Projects In 50 Days (HTML, CSS & JavaScript) - Sharpen your skills by building 50 mini projects!

Setting up a React project with the “Create React App” package

By Michael Burrows | Last modified July 25th 2020

Create React App allows you too quickly set up a React app with a single terminal command.

It’s great for when you want to jump in and start coding without having to mess around with configuration.

The only prerequisite is to have a recent version (8.10+) of Node.js installed.

To get started open terminal and run the create-react-app command:

npx create-react-app hello-world

Replace hello-world with your project name.

Once the installation is complete switch to the newly created directory and start the project:

cd hello-world && npm start

This will open the below page in a browser on a live development server at localhost:3000.

Create React App launch page

At this point you can make code edits and the project will automatically recompile and reload the browser.

If for some reason the live reloading isn’t working for you try running the following command:

npm cache clean --force

That concludes the setup, when your app is ready for deployment run the following command:

npm run build

This will create a new “build” folder in the project with the optimised code and assets to deploy.

Related Posts