8

How To Build Your First React JS Application

 1 year ago
source link: https://www.laravelcode.com/post/how-to-build-your-first-react-js-application
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

How To Build Your First React JS Application

  361 views

  6 months ago

React

React.js is one of the most popular JavaScript library today. React.js most of use for a frontend side in website development. using the react.js you can make a very smooth web application. In this article, we will share with you how to create the first React.js Application in our local system.

Requirement

If you create first react.js application in a live server or a local system you should me installed the following things in your local system or live server.

It sets up your development environment so that you can use the latest JavaScript features, provides a nice developer experience, and optimizes your app for production. You’ll need to have Node >= 8.10 and npm >= 5.6 on your machine. To create a project, run:

How to install node.js latest version in ubuntu please visit the following link it will help you install and setup node.js in your local system.

Create a New React App

Run the following command in your terminal for creating a new fresh React.js application.

sudo npx create-react-app my-first-app --use-npm

After done or create React.js application in your local system. application structure looks like bellow.

my-first-app
├── build
├── node_modules
├── public
│   ├── favicon.ico
│   ├── index.html
│   └── manifest.json
├── src
│   ├── App.css
│   ├── App.js
│   ├── App.test.js
│   ├── index.css
│   ├── index.js
│   ├── logo.svg
│   └── serviceWorker.js
├── .gitignore
├── package.json
└── README.md

in react.js application main entry point file is src/index.js file.

Run React App

After done create react.js first application our local system then how to run it? just run the following command in the terminal.

cd my-first-app
sudo npm start

After running the above command in terminal then the following output show in your terminal. please see the following screenshot.

run_react_application.png

Now, run the http://localhost:3000 in your browser and your first react.js application landing page look like:

reactjs-lalnding-page.png

Conclusion

As you can see, create a react.js application is very easy we hope you like this article. if you like it then please give thumbs up and write the comment regarding any issue or questions.

Author : Harsukh Makwana
Harsukh Makwana

Hi, My name is Harsukh Makwana. i have been work with many programming language like php, python, javascript, node, react, anguler, etc.. since last 5 year. if you have any issue or want me hire then contact me on [email protected]


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK