Things We Should Know About React

Abu Saleh Faysal
2 min readMay 7, 2021

We often hear React as a JavaScript framework. However, react is a JavaScript Library. Libraries and frameworks are not the same things. There are different benefits of different JavaScript libraries. React as a JavaScript library is very good at building user interfaces efficiently.

The framework is where a lot of things are already built for you. You will have a complete pathway and follow along with the framework, whereas Library is different from the framework. Think of a virtual library, and you need a book, you can collect it. The same concept applies in programming as well, and unlike framework in libraries, if we need something, we can grab that and use it.

There is a term that frequently hits our mind, that is DOM. If you imagine a tree and rotate it 180 degrees clockwise, we will find the root on the upper and the branches below. And that is precisely a DOM works.

However, in React, we talk about virtual DOM rather than actual DOM. In Virtual DOM, the ideal UI representation is kept in memory and sync with the real DOM with the help of React DOM.

Because of the use of Virtual DOM, the performance of React is efficient than the regular DOM. Although, there are more ways to get optimizing performance.

For deploying a React app, we may use a command, “npm run build”.

There is another technique for optimizing, which is called “windowing”. This process renders a small portion of code instead of generating the whole application.”react-window” is a popular windowing library; it helps us provide components that can be used multiple times.

We already talked about virtual DOM and how it makes the system more efficient than the usual DOM. Even if it works excellent, we need to be careful while designing and building components.

We all know that React has a significant advantage in components. We can reuse components as many times as we want. So we should make the component in a way that we can use the same component in different places.

Besides, we can pass different data from one component to another component by using props.

--

--

Abu Saleh Faysal

Software Engineer at Onethread | Front-End Developer | Blockchain Enthusiast | JavaScript | TypeScript | React | Redux