React is a JavaScript library for building user interfaces. React has a few different kinds of components, that are part of React.Component
subclasses.
Install npm and then run following commands on terminal to start with react.
npm install -g create-react-app
create-react-app my-app
cd my-app
npm start
It will take you to browser on URL localhost:3000.
First call is in src/index.js.
ReactDOM.render(
App, document.getElementById('root')
);
A component takes in parameters, called props
, and returns a hierarchy of views to display via the render
method.
The render
method returns a description of what you want to render, and then React takes that description and renders it to the screen. In particular, render
returns a React element, which is a lightweight description of what to render.
Source : https://facebook.github.io/react/tutorial/tutorial.html#what-is-react