Instead of useHistory I am trying to use navigate. But it's always showing me React Hook useEffect has missing dependencies: 'navigate' and 'setUser'. Either include them or remove the dependency array
useEffect(() => {
    auth.onAuthStateChanged(async (user) => {
        if(user) {
             setUser(user);
             navigate('/home');
        }
        
    })
}, [userName,setUser, navigate]);
const handleAuth = () => {
    auth.signInWithPopup(provider).then((result) => {
        setUser(result.user);
    }).catch((error) => {
        alert(error.message);
    })
}
const setUser = (user) => (
    dispatch(setUserLoginDetails({
        name: user.displayName,
        email: user.email,
        photo: user.photoURL,
    }))
)
code sandbox link: https://codesandbox.io/s/misty-morning-1h37q6?file=/src/countdown.jsx
if you inspect element, and check the logs, you will see that it is running on the background.
Any help will be appreciated.
 
     
     
    