1.useEffect is an alternative of life cycle functions in class component, useEffect could replace componentDidMount,componentDidUpdate and componentWillUnmount
2.useEffect without second parameter -- componentDidMount+componentDidUpdate 3.useEffect without an empty array as second parameter ===componentDidMount
a.function in useEffect with an empty array -- componentDidMount
b.return function in useEffect with an empty array -- componentWillUnmount
4.useEffect with filled array -- specific componentDidUpdate which is monitored by this useEffect