Use Effect

The useEffect Hook allows you to perform side effects in your components. useEffect accepts two arguments.
The second argument is optional.
one is Arrow Function and another one is dependency after return statement , if we want to execute a function we can use " UseEffect".

useEffect(() => {
},
[]);

How it will work :
it will work like as a three methods that means useEffect() will depends on second Argument.
1. componentDidMount() or CDM :
Api Integration 2. ComponentDidupdate :
Prev props , prev state -> preves state and props is changed then it is used to update that state & props. 3. componentwillUnmount :
clearn up operations