Is it possible to group independent code and make it reusable in program?

Components in React are used to group independent code and make it reusable across different parts of the application.

Yes, it is..

Now let's understand react and its components.

Introduction to  REACT

An open-source JavaScript library for creating rich user interfaces. You can have a responsive design, quick user interaction, smooth transitions, faster content loading, etc.

React consists of various components that are part of User interface. There are 2 types of Components in React-   1. Stateless Functional  2. Components Stateful Class Components

Components of  REACT

Get an overview of REACT components and how they differ.

Click Here...