• sashi

React.js - HelloWorld Example (Basic)

To configure React app from scratch can be tedious. You need to research and figure out the build tools such as Webpack and Babel transpiler.


However, the React core team made the configuration simple. "react-app my-app." is a way to create single-page React applications easy. You do not need to install and play around with Webpack, and Babel transpiler. They are preconfigured into the package.


The example below is for Windows.


To download and install necessary modules, type

npm init react-app helloworld

It starts giving you the output as below. Please wait a little bit until it finishes.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template 
...

When the install is done, type the following.

cd helloworld npm start



That's it. If you see the page below, you have done it!



6 views0 comments

Recent Posts

See All