Life cycle Using React Hooks :

yeah we have useeffect life cycle hook we can mainly concentrate on 3 lifecycle methods .
1. componentDidMount ,
2. componentdid Update
3. componentwill Unmount.
for example if we write i mean inside the useeffect we can write call back function what ever code will return in that it will be take it as componentDid Mount .
And also inside that we can write one return method what ever code return inside that it will be called after the componentwill Unmount.
and also we pass second parameter as array of parameter for the useeffect .
when ever the parameter is updates the useeffect will be called when ever the value update at that time we can take it as a componentDid Mount.



React Lifecycle has 4 phases :

1. Initial Phase

2. Mounting Phase

- componentDidMount()
- componentWillMount()

3. Updating Phase
- componentDidUpdate()
- shouldComponentUpdate()
- componentWillUpdate()

4. Unmounting Phase

- ccomponentWillUnmount()

1. Initial Phase : It is the birth phase of the lifecycle of a ReactJS component.
Here, the component starts its journey on a way to the DOM. In this phase, a component contains the default Props and initial State. These default properties are done in the constructor of a component.

2. Mounting Phase : Mounting means putting elements into the DOM.
Or
In this phase, the instance of a component is created and inserted into the DOM.

3. Updating Phase :It is the next phase of the lifecycle of a react component. Here, we get new Props and change State. This phase also allows to handle user interaction and provide communication with the components hierarchy. The main aim of this phase is to ensure that the component is displaying the latest version of itself. Unlike the Birth or Death phase, this phase repeats again and again.

4. Unmounting Phase :It is the final phase of the react component lifecycle. It is called when a component instance is destroyed and unmounted from the DOM.