<Navigate> ↔ React Router FC to Declaratively trigger navigate
function Page() {
const [redirect, setRedirect] = useState(false)
if(redirect) return <Navigate to="/login" /\>
return //...
}
state
prop to pass info onto child route to config redirect logic, access via location.state
References
<RequireAuth>↔ custom FC Wrapper to Declaratively control Protected Route viauseAuth()&<Navigate\>fromreact-router-dom