import React, { useContext } from "react"; import { Navigate, Outlet, useLocation } from "react-router-dom"; import { AuthContext } from "../App"; import { showWarnToastNotification } from "../components/ToastNotification"; function UnAuthOnlyRoutes() { let location = useLocation(); const auth = useContext(AuthContext); const handleRouteRender = () => { if (auth !== true) { return ; } else { showWarnToastNotification(

Already logged in!

); return ; } }; return handleRouteRender(); } export default UnAuthOnlyRoutes;