Skip to content

Instantly share code, notes, and snippets.

@RomikMakavana
Created June 4, 2022 10:23
Show Gist options
  • Save RomikMakavana/48a340f2ba7fc1fcce8a8c3d0a4f6afa to your computer and use it in GitHub Desktop.
Save RomikMakavana/48a340f2ba7fc1fcce8a8c3d0a4f6afa to your computer and use it in GitHub Desktop.
React Auth Guard Routes UnAuthRoutes.js
import React from "react";
import { Route } from "react-router-dom";
import UnAuthGuard from "../guards/UnAuthGuard";
import Login from "../pages/Login";
import Register from "../pages/Register";
const UnAuthRoutes = [
<Route key="Login" path="/login" element={<UnAuthGuard component={<Login />} />} ></Route>,
<Route key="Register" path="/register" element={<UnAuthGuard component={<Register />} />} > </Route>
]
export default UnAuthRoutes;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment