Thursday, August 4, 2016

Hello World with React

First create a folder called hello-world-react and initialize npm within the folder.
For this demo, you must have installed webpack. Next install following node packages.
Next create following files in  the project folder.
Edit webpack.config.js file like below.
index.html file content should be like below.
Next edit App.js file like below.
Now we need to change main.js file accordingly.
Next we need to edit package.json file to add start script.
Run our first react project using following command.
In browser for localhost:8888, and you will see following content. Now you can edit your project content and it will automatically reder in browser.

No comments:

Post a Comment