React JS — An Introduction
2 min readNov 4, 2023
“React is an open-source frontend JavaScript library that is used for building interactive user interfaces and single page web applications that primarily follows component based approach”.
History…
According to Wikipedia — React was created by Jordan Walke, a software engineer at Meta, who released an early prototype of React called “FaxJS”.
He was influenced by XHP, an HTML component library for PHP.
Features of React…
1- Virtual DOM
2- Component Based Approach
3- JSX
4- One way data binding
→ Virtual DOM:
- Virtual DOM is a blue print or we can say that a copy of real DOM that is placed in the memory and synced with real DOM.
- It passes only the updated state of the component to the real DOM and prevents the re-rendering of the entire component.
- Due to this process, the overall performance of the application improves.
→ Components in React…
- Components are the reusable bit of code that combine together to form the entire react application.
- They are independent pieces of code and the entire react application is divided into these components.
- They are the building blocks of react application.
→ JSX
- JSX is Java Script XML which has HTML like syntax.
- With the help of JSX, we can use HTML tags inside React.
- It converts HTML tags into react elements.
import react from 'react';
function greet (){
return <h1> Hello World <h1/> //This is JSX.
};
In the above example, the function is returning the HTML tag <h1> that is nothing but JSX.
→ One way data binding…
- One way data binding means that the data will flow only in one direction in react.
- React does not support multi-direction binding.
- Due to unidirectional flow, debugging becomes very easier in react.
- The data usually flows from parent component to child component in the form of props.
Conclusion…
So, React is indeed a useful JavaScript frontend library that can be used to develop web applications with the help of various features that we discussed above.
Keep Learning !!👍
Thank You😀😀