Create a React web site

The React framework adds components on top of HTML and JavaScript to create dynamic one-page web applications. It does not have routing and data handling capabilities, to create a full stack web application use Next.js or Remix.

Configure the development environment

  • Install npm
  • Make sure npx is available on your workstation
    npx comes with npm 5.2 and higher

Create the React web site skeleton

Create the web site skeleton

View the new React web site

  • Step into the web application directory
  • Start the web application
    npm start
  • If asked, allow iTerm to control Google Chrome
  • Your React application loads in a new browser window at http://localhost:3000/

Test the application

By default the test are related to the changes made since the last Git commit.

  • If running, stop the application by pressing CTRL-C
  • Open the terminal in the application directory
  • Execute the test
    npm test

Deploy the application

Build the application

The application build process creates the minified version of the site in the “build” directory

  • To build a minified bundle of the application execute
    npm run build

Leave a comment

Your email address will not be published. Required fields are marked *