title: Navigate on React router dom v6 loop problem
body: <p>I using react-router-dom v6. But when i want navigate its going to loop. I just want if url isnt one of that routes just navigate to &quot;foo&quot; url. In v5 version i can do it easily with redirect. But in v6 havent redirect so i must use navigate. But its making loop. My code :</p>
  <pre><code>const Login = React.lazy(() =&gt; import(&quot;./login&quot;));
  export const AppViews = () =&gt; {
    return (
      &lt;Suspense fallback={&lt;p&gt;Loading...&lt;/p&gt;}&gt;
        &lt;Routes&gt;
          &lt;Route path={`${AUTH_PREFIX_PATH}/login`} element={&lt;Login /&gt;} /&gt;
          &lt;Route
            path=&quot;*&quot;
            element={&lt;Navigate to={`${AUTH_PREFIX_PATH}/login`} replace /&gt;}
          /&gt;
        &lt;/Routes&gt;
      &lt;/Suspense&gt;
    );
  };
  
  export default AppViews;
  </code></pre>
  <p>What is wrong in that code i really cant figure out. When path is /auth/login shouldn't it open element Login basicly? Its going loop when i make like this. Thank you for replies!</p>