×
  • React – The Complete Guide (incl. React Router 4 & Redux)

  • 04 – Using Create React App Package

    Lesson List

    In this lesson, we will see the tool which will Create React App. there is a GitHub repository it is called as Create React App you can see the repo here LINK. this is maintained by basically facebook or a community around facebook, so its an officially recommended tool for creating the react projects.
    so let’s start with installation.


    Installation

    We will install the Create react App GitHub repository globally using the NPM and NPM is simply node package manager, a tool that automatically get when installing NodeJS which makes easier to manage third party packages, over javascript packages and at the end Create React app is just such a package to use NPM we need to install NodeJS.
    So after installing the nodejs in mechine go to the terminal and use this command to install the Create react App package.

    Bash
    
    npm install create-react-app -g
    
    Note:
    1. -g is a flag which will install the package globally no matter from where you run this command.
    2. In Mac or Linux you will have to run with the sudo npm install ... to get the right permission of that command. And you will be prompted for your password.

    After Installing the package we can finally create the new React app.


    Create React App

    Once we have install the package we can go into the directory where we will store the code. After going into perticular folder you can type in this command

    Bash
    
    create-react-app burger-builder
    

    It will automatically create a folder and install all the dependencies it needs.

    burger-builder will be the name of the folder where default configuration and a lot of starting files will be placed.

    once the setup is completed you can navigate into that folder with command cd burger-builder
    And after that simply run the command

    Bash
    
    npm start
    

    After the command is initeated the browser will be open with the link http://localhost:3000/. this is the development server which loads our react app on port :3000 and reload the page when ever we change the code(file).
    Always keep this process running if you are working on your application.

    React introduction
    Create React App
  • We use cookies in order to give you the best possible experience on our website. By continuing to use this site, you agree to our use of cookies.
    Accept