1. No dependency passed:
1 useEffect(() => {
2 //Runs on every render
3 });
2. An empty array:
1useEffect(() => {
2 //Runs only on the first render
3 }, []);
3. Props or state values:
1useEffect(() => {
2 //Runs on the first render
3 //And any time any dependency value changes
4 }, [prop, state]);