Necesita activar useNavigator() si un usuario ha iniciado sesión, o mostrar un componente de interfaz de usuario importado si no lo está.
Configuré las rutas del navegador desde mi App.js:
La página de inicio se dirige a "/"
Otra página se representa en "/app".
Déjame saber si debo proporcionar más detalles. ¡Gracias por la ayuda!
import React from "react" import '../App.css'; import {HeroLayout3} from "../ui-components" import { Auth, Hub } from 'aws-amplify'; import { useNavigate } from "react-router-dom"; export function Home() { let navigate = useNavigate() return ( Auth.currentAuthenticatedUser({ bypassCache: true }).then(() => navigate('/app')).catch(<HeroLayout3 width="100vw" height="79vh"/>) ); } export default Home;