In Depth Of React JS

Mehraj Rahman
2 min readMay 16, 2021

Hello Coders! Hope so you all are doing well. In this article you will learn some interesting things about React. Hope so you will enjoy this article.

FRAMEWORK:

I think you heard this word very often. Framework is very large and contain a self maintained rules. Here you can’t write code in your own way. You will have to follow the rules and restriction of the frame work. Also if you want to add a a simple piece, also then you will have to include the whole framework. One thing you must notice that it inverts the control of the program. It tells the developer what they need.

LIBRARY:

It’s different from Framework. It is not too big like a framework. Here you will find a simple solutions of a big problems. Usually a developer calls a library where he need to use it. Which is totally different from framework.

React JS is a library:

Yes, you read this right. ReactJS is a JavaScript library which is used by lot of peoples around the world. The code in react is written in a smaller part and then connected all the smaller components and connect them together. It’s also declarative.

React is all about components:

In react, we use components to complete the code. If you see a react based project then you will find out a folder of components. here you will find lots of components folder. Each and every components is connected at the end and completes the code.

COMPONENTS STRUCTURE:

You can create react components in two ways. One is using function and other is using classes. Right now using function is very common but in past developer used classes very often. One thing you will notice that components name start with a capital letter. There is a reason behind it.

Benefits Of Components:

If you talk about the benefits of the react components then at first you will talk about its reuse ability. You can reuse a react components as many times you need. Also you can use a react components in other projects. Also react components make code easy readable which is also a great advantage.

Hooks in React:

In react, hook is one kind of special function. There are different types of hooks in react. useState, useEffect, useHistory are very common. You will use state hook to store some data in your code so that you can use them in your own way. You will use effect to call api and collect the data. usehistory is use to navigate into private links.

--

--