I use the useEffect hook inside functional components with a dependency so that dependency changes , useEffect function will re-run like this :
const [show, setShow] = React.useState(false);
React.useEffect(() => {
console.log("Do something")
} , [show]);
I wanted to know what is available in react's class component to do exactly like this ? Is there any lifecycle method to have this functionality ?
you can use combination of
componentDidMountandcomponentDidUpdate: