1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-12-01 17:04:19 +00:00
pds-2021-g2-nest/nest_frontend/routes/PageRoot.js

14 lines
326 B
JavaScript

import React, { useContext } from "react"
import ContextUser from "../contexts/ContextUser"
import { Redirect } from "react-router"
export default function PageRoot() {
const { state } = useContext(ContextUser)
if(!state) {
return <Redirect to={"/login"}/>
}
return <Redirect to={"/dashboard"}/>
}