From dc9e018a67f3a3bb88c1acc98fd53de3be07f714 Mon Sep 17 00:00:00 2001 From: Pavindu Lakshan Date: Wed, 7 Aug 2024 08:20:32 +0530 Subject: [PATCH] Fix react router v6 example --- API.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/API.md b/API.md index c4b0103..28fef57 100644 --- a/API.md +++ b/API.md @@ -189,7 +189,7 @@ It's also possible to implement your own routing logic to secure the protected r Create a reusable component that redirects user to the sign in page based on the authentication status. -**ProtectedRoute.js** +**ProtectedRoute.jsx** ```js import { useAuthContext } from '@asgardeo/auth-react'; @@ -220,7 +220,7 @@ Use the `ProtectedRoute` as follows, in your route definition. ```js import { AuthProvider } from '@asgardeo/auth-react' -import { Routes, Route } from 'react-router-dom' +import { BrowserRouter as Router, Routes, Route } from 'react-router-dom' import ProtectedRoute from './components/ProtectedRoute' import Home from './pages/Home' import Dashboard from './pages/Dashboard'