React basics: explaining the useEffect hook