ReactJS Introduction
ReactJS is a declarative, efficient and flexible Javascript library for building User Interfaces. It is developed and mantained by Facebook. It is an open source, component based library specifically for the front end.
Why use ReactJS?
ReactJS offers graceful solutions to some of the front-end's most persistent issues. It is fast, scalable, flexible and powerful. It uses virtual DOM (Document Object Model), which enhances the performance of the app.
Prerequisites
In order to be working with React, you need to have solid understanding of Javascript, HTML5 & CSS. ReactJS uses JSX, which is similar to HTML, so your HTML knowledge will be helpful. The knowledge of ES6 will also be very helpful. So it is recommended to cover HTML, CSS & especially JavaScript first before diving into ReactJS.
Example
Let's go through an example on how React code looks like:
import React from 'react';
import ReactDOM from 'react-dom';
class Test extends React.Component {
render() {
return <h1>Hello World!</h1>;
}
}
ReactDOM.render(<Test />, document.getElementById('root'));