How to convert Life Cycles methods into useEffect hook?
In this article, I’ll show you how to map react life cycles to useEffect hook. React Class components Life cycles List 1) componentDidMount() {}
2) componentDidUpdate(prevProps, prevState, snapshot) {}
3) shouldComponentUpdate(nextProps, nextState) {}
4) componentWillUnmount() {} 1- ComponentDidMount
Pass an empty dependency…