title: Redirect does not redirect to home page instead redirects to setup page with redux
body: <p>I want to redirect homepage to setup page after redux action compleated. App.js Code is</p>
  <pre><code>const companyDetails = useSelector((state) =&gt; state.companyDetails);
  const { loading, error, company } = companyDetails;
  useEffect(() =&gt; {
    if (!company) {
      dispatch(detailsCompany());
    }
  }, [dispatch, company]);
  return loading ? (
    &lt;LoadingBox&gt;&lt;/LoadingBox&gt;
    ) : error ? (
    &lt;MessageBox variant=&quot;success&quot;&gt;{error}&lt;/MessageBox&gt;
    ) : (
    ...otherRoutes
     &lt;Route path=&quot;/&quot; exact&gt;
        {company ? (
          userInfo?.isAdmin ? (
            &lt;DashboardScreen /&gt;
          ) : (
            &lt;HomeScreen /&gt;
          )
        ) : (
          &lt;Redirect to=&quot;/setup&quot; /&gt;
        )}
      &lt;/Route&gt;
  )
  </code></pre>
  <p>After redux action completed, company variable has value but it is redirected to setup page instead home page or dashboard.</p>