Comment naviguer programmatiquement dans le composant de classe React Router V6

<Navigate to="/dashboard" replace={true} /> (Write this in your dom anywhere) example below;

import { Navigate } from "react-router-dom";

<div>
     {isUserLoggedIn ? (
        <Navigate to="/login" replace={true} />
      ) : null}
</div>
Timur Turbil