1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-25 22:44:19 +00:00
pds-2021-g2-nest/nest_frontend/routes/PageRoot.js

15 lines
326 B
JavaScript
Raw Normal View History

import React, { useContext } from "react"
2021-04-26 16:36:41 +00:00
import ContextUser from "../contexts/ContextUser"
import { Redirect } from "react-router"
export default function PageRoot() {
2021-05-11 14:37:15 +00:00
const { state } = useContext(ContextUser)
if(!state) {
return <Redirect to={"/login"}/>
}
return <Redirect to={"/dashboard"}/>
}