ReactJS Tutorials

  • Last Updated : 22 Mar, 2021

GeeksforGeeks - Summer Carnival Banner

React is a declarative, efficient, and flexible JavaScript library for building user interfaces. It’s ‘V’ in MVC. ReactJS is an open-source, component-based front-end library responsible only for the view layer of the application. It is maintained by Facebook.

ReactJS Tutorial

React uses a declarative paradigm that makes it easier to reason about your application and aims to be both efficient and flexible. It designs simple views for each state in your application, and React will efficiently update and render just the right component when your data changes. The declarative view makes your code more predictable and easier to debug.

Prerequisite: To start learning to React you have to know a few important things. 

Learner to guide, you can follow this article: 



Reasons to learn React: React is a declarative, efficient, and flexible JavaScript library for building user interfaces. React.js is an open-source, component-based front-end library responsible only for the view layer of the application. It is an MVC architecture-based library that plays the role of “C” which means control.

React uses a declarative paradigm that makes it easier to reason about your application and aims to be both efficient and flexible. It designs simple views for each state in your application, and React will efficiently update and render just the right component when your data changes. The declarative view makes your code more predictable and easier to debug.

Features of React.js: There are unique features are available on React because that it is widely popular.

  • Use JSX: It is faster than normal JavaScript as it performs optimizations while translating to regular JavaScript. It makes it easier for us to create templates.
  • Virtual DOM: Virtual DOM exists which is like a lightweight copy of the actual DOM. So for every object that exists in the original DOM, there is an object for that in React Virtual DOM. It is exactly the same, but it does not have the power to directly change the layout of the document. Manipulating DOM is slow, but manipulating Virtual DOM is fast as nothing gets drawn on the screen. 
  • One-way Data Binding: This feature gives you better control over your application.
  • Component: A Component is one of the core building blocks of React. In other words, we can say that every application you will develop in React will be made up of pieces called components. Components make the task of building UIs much easier. You can see a UI broken down into multiple individual pieces called components and work on them independently and merge them all in a parent component which will be your final UI. 
  • Performance: React.js use JSX, which is faster compare to normal JavaScript and HTML. Virtual DOM is a less time taking procedure to update webpages content. 

Example:

App.js

import React from 'react';
import ReactDOM from 'react-dom';
 
var name = "Learner";
 
var element = <h1>Hello, { name }.Welcome to GeeksforGeeks.< /h1>;
  
ReactDOM.render(
    element, 
    document.getElementById("root")
);

Output:

Learn more about ReactJS:

ReactJS Complete References:

My Personal Notes arrow_drop_up


Writing code in comment? Please use ide.geeksforgeeks.org, generate link and share the link here.