Skip to content

Commit

Permalink
feat: add prefetch component to route
Browse files Browse the repository at this point in the history
Signed-off-by: Prince Muel <[email protected]>
  • Loading branch information
princemuel committed May 12, 2023
1 parent b2c557c commit 26604b3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/routes/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { Layout } from '@src/components';
import Prefetch from '@src/lib/middleware/prefetch';
import {
Route,
createBrowserRouter,
createRoutesFromElements,
} from 'react-router-dom';
import { PersistLogin, RequireAuth } from '../lib';
import { PersistLogin } from '../lib';
import { LoginRoute, RegisterRoute } from './auth';
import { HomeRoute } from './home';
import {
Expand All @@ -21,7 +22,7 @@ export const router = createBrowserRouter(
<Route path='register' element={<RegisterRoute />} />

<Route element={<PersistLogin />}>
<Route element={<RequireAuth />}>
<Route element={<Prefetch />}>
<Route index element={<HomeRoute />} />

<Route path='invoices'>
Expand Down

0 comments on commit 26604b3

Please sign in to comment.