I am using react-redux and redirecting users based on the value of prop. How can I handle the error produced in the console?
I have used useEffect to push users to different components based on props. I'm not sure if this is the correct way to do this.
  useEffect(() => {
    if (isAuthenticated) {
      history.push("/");
    } else if (signup) {
      history.push("/signup");
    }
  });
Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function.
 
     
     
    