Friday 3 January 2020

Create a new application in ReactJs


After setting up the development environment as per previous article. Now we can create an application in ReactJs.

Step1Setting up React Boilerplate. We will install the boilerplate globally. Run the below command in your terminal or command prompt to install the React Boilerplate.

npm install -g create-react-app
create-react-app is a module to give feature of compiling and transpiler. It will create a single page application & provide all the server configuration to run on local and prod server.

create-react-app my_app
OR
npx create-react-app my_app

The above statement will create a new directory named my_app inside your current directory with a bunch of files needed to successfully run a React app.
Let’s have a look at the directory created by the above command:
Step2:  go to application folder and run the application in local server using below command.

cd my_app
npm start
On successfully running the above command your compiler will show run the application and show the message with URL

If you run that URL on browser then you will see the  below screen and This is your application in reactjs


Now we will move ahead to start learning ReactJS development to make some use of it.






No comments:

Post a Comment