React #4 - Introduction to component, type of component available in react(Functional & Class Based)

Опубликовано: 25 Июнь 2026
на канале: Let's Build With Code
28
0

Click to watch React Playlist:    • React  

To view the code of this tutorial. Please visit this Github link:
https://github.com/lets-build-with-co...

What is component

In programming, a component is a modular, reusable, and self-contained part of a software system. It performs a specific function and can interact with other components through well-defined interface.


In React, there are primarily two types of components:

Functional Components :

These are simple JavaScript functions that return JSX (JavaScript XML). They do not have their own state or lifecycle methods but can use hooks like useState and useEffect to manage state and side effects.


Class Components :

These are ES6 classes that extend from React.Component. They have their own state and lifecycle methods like componentDidMount, componentDidUpdate, and componentWillUnmount.