What is Components in React JS?

What is component?

Components in React JS are the basic building blocks, which are used to create the UI. Using components we can divide the whole website in multiple parts, which make the code debugging and maintenance a lot easier.

In simpler terms we can divide the whole website in parts, like a main header, a footer, a contact page and a homepage.

React JS will only update the component or part of the website which are changed. Components are of two types, Class based components and Function based components. Nowadays class based components are not used much, due to the easier function based approach.

Example :-

Header
Body
Footer
Output

Note : It is not necessary to use the components, but it makes the maintenance easier.

Leave a Reply

Your email address will not be published. Required fields are marked *