In React.js, a component is a reusable, self-contained building block of a user interface. Components allow you to split the UI into independent and reusable pieces, making it easier to manage and organize your application. React components can be either functional or class-based, and they can have their own state and lifecycle methods.
There are two main types of components in React:
Functional components
Class components
Pure components
High-Order-Components(HOCs)