Posted inJavaScript / jQuery / Programming / ReactJS / Technology

Simple React Hello World Example

Today, We want to share with you Simple React Hello World Example.In this post we will show you react js basics example tutorial, hear for react js examples for beginners we will give you demo and example for implement.In this post, we will learn about react js sample project step by step with an example.

Simple React Hello World Example

There are the Following The simple About Simple React Hello World Example Full Information With Example and source code.

As I will cover this Post with live Working example to develop understanding react js, so the install react and create react app Directory structures for this example is following below.

React js sample project step by step

It simple displays a heading saying “Hello, world!” on the web page.

Syntex

ReactDOM.render(
  

Hello, world!

, document.getElementById('root') );

Step 1: Run these commands:

npm i
npm start

We only have to simple run npm i the first time using CMD.

Step 2: package.json

{
  "name": "hello-react",
  "version": "1.0.0",
  "description": "pakainfo - Simple React Hello World",
  "main": "index.js",
  "scripts": {
    "start": "browserify -t babelify --outfile public/firstweb-app.js src/hello.jsx && echo 'Open http://localhost:8000/ in your browser' && (cd public ; python -m SimpleHTTPServer)",
    "watch": "watchify -v -t babelify --outfile public/firstweb-app.js src/hello.jsx"
  },
  "author": "",
  "license": "ISC",
  "repository": "none",
  "devDependencies": {
    "babelify": "^6.3.0",
    "browserify": "^11.2.0",
    "watchify": "^3.4.0"
  },
  "dependencies": {
    "react": "^0.14.3",
    "react-dom": "^0.14.3"
  }
}

Step 3: public_index.html



  
    Simple React Hello World - pakainfo.com
  
  
    

pakainfo.com - Simple React Hello World

Step 4: src_hello.jsx

import React from "react";
import ReactDOM from "react-dom";

const Hello = function(name) {
  return (
    
Hello, {name}
); }; const view = Hello("Will"); const element = document.getElementById("root"); ReactDOM.render(view, element);
Web Programming Tutorials Example with Demo

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about Simple React Hello World Example.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

I am Jaydeep Gondaliya , a software engineer, the founder and the person running Pakainfo. I'm a full-stack developer, entrepreneur and owner of Pakainfo.com. I live in India and I love to write tutorials and tips that can help to other artisan, a Passionate Blogger, who love to share the informative content on PHP, JavaScript, jQuery, Laravel, CodeIgniter, VueJS, AngularJS and Bootstrap from the early stage.

Leave a Reply

Your email address will not be published. Required fields are marked *

We accept paid guest Posting on our Site : Guest Post Chat with Us On Skype