React.js
React.js is a popular JavaScript library used for building user interfaces, particularly for single-page applications where you want a dynamic and responsive user experience. It was developed and is maintained by Facebook.
Important Features of React JS
Component-Based Architecture
Component-Based Architecture is a design pattern used in User Interface design framework. It divides smaller, reusable and independent piece called component which has its own logic, structure and behavior. Component based architecture is a core principle of React.js and one of main reasons of its popularity and effectiveness in building User Interface.
Advantages
Enhanced Reusability :- Same component can be used in multiple place while developing a application, hence it reduce the time of development and create a constant look and feel.
Virtual DOM (Document Object Model)
Document Object Model is the important part of web as it divides into modules and executes the code. In JavaScript whole DOM is updated at once if certain change is made on the particular node which makes the web application slow. React use virtual DOM. Virtual DOM is the exact copy of real DOM.
In React JS,
Recommended by LinkedIn
Declarative Programming
Declarative Programming is the programming pattern that express the logic of program execution rather than its control flow. It does not describe the step by step process of the executed program instead focus on the expected result. React JS is the JavaScript library that is uses for building user interface in declarative manner. Describe how UI should look based on the application state and React update the DOM automatically.
JavaScript XML (JSX)
JavaScript XML is a syntax extension for JavaScript that let you to write HTML-like markup inside a JavaScript file. It make easier to visualize and understand the structure of user interface. JSX uses the attribute similar to HTML to pass the properties to the React component.
example :-
const element = <img src={user.avatarUrl} alt={user.name} />;
Single Page Application
A Single Page Application is a web app implementation that loads only a single web document, rather than updating the whole new pages from the server.
It allows users to use websites without loading whole new pages from the server, which increase the performance and more dynamic experience. By utilizing the component-based architecture of React, developers can easily break down their application into individual pieces without affecting other parts of the code base. This ensure that only relevant code is modified when changes or update are made.
Advantages