What is ReactJS?šŸ¤”

Madusanka Wattaladeniya
4 min readMay 15, 2022

ReactJS is a JavaScript toolkit for creating reusable user interface components that declarative, fast, and flexible. Itā€™s an open-source, component-based front-end library that exclusively handles the applicationā€™s view layer. It was created and maintained by Facebook and later utilized in Facebook products such as WhatsApp and Instagram.

Letā€™s see how we can create react project šŸ‘€

  • There is an easy way to create react projects quickly. We need to run a few simple commands to create a new React project.
create-react-app
  • We can use the above command to create React project. So, it is a great tool for beginners to create and run React projects easily.

Letā€™s go on the step by step šŸ‘£

  • Letā€™s run the following command to install React using the npm package manager. here I used vs code to create this project.
npm install -g create-react-app
  • After completing the installation, we can create a new React project using the following command.
npx create-react-app 'Name of your project folder"
  • It will take some time for the above command to install React and build a new project named ā€œreactprojectā€. We can see the terminal as shown below.
  • Now we can run this project using the following command and we can access the application on the browser.
cd reactproject
npm start
  • Now, we will get the browser like this,

Letā€™s see what are the features of ReactJS šŸ‘€

ReactJS is quickly becoming the most popular JavaScript framework among web developers.

  • JSX
  • Components
  • One-way Data Binding
  • Virtual DOM
  • Simplicity
  • Performance

JSX

JavaScript XML is known as JSX. Itā€™s a syntactic extension for JavaScript. ReactJS uses an XML or HTML-like syntax. This syntax is converted into React Framework JavaScript calls. It enhances ES6 to allow HTML-like text and JavaScript react code to coexist. It is not required to utilize JSX, however it is strongly encouraged in ReactJS.

Components

Components are at the heart of ReactJS. A ReactJS application consists of several components, each with its own logic and controls. These components are reusable, which makes it easier to keep the code clean while working on larger projects.

One-way data binding

ReactJS is built to follow unidirectional data flow, often known as one-way data binding. One-way data binding provides you with more control across the application. If the data flow occurs in the other way, additional characteristics are required. Itā€™s because components are intended to be immutable, and the data they contain isnā€™t supposed to change.

Virtual DOM

The original DOM object is represented by a virtual DOM object. It functions similarly to a one-way data binding. The complete UI is re-rendered in virtual DOM representation whenever any changes are made to the web application. Then it compares the old DOM representation to the new DOM representation. After that, the true DOM will only update the elements that have truly changed. This speeds up the application and eliminates memory waste.

Simplicity

ReactJS makes use of a JSX file, which makes the application easy to develop and comprehend. ReactJS is a component-based approach, which means the code may be reused as needed. This makes it easy to use and understand.

Performance

ReactJS is well-known for its speed. This characteristic sets it apart from other frameworks available today. This is due to the fact that it controls a virtual DOM. The Document Object Model (DOM) is a cross-platform computer programming API for HTML, XML, and XHTML. The DOM is totally stored in memory.

Hope you learned something from this article. šŸ˜€

Thank you!

--

--