mkstackwithwelshman/src/AppRouter.tsx

21 lines
622 B
TypeScript
Raw Normal View History

2025-06-01 16:26:09 -05:00
import { lazy } from "react";
2025-04-17 16:53:23 -05:00
import { BrowserRouter, Route, Routes } from "react-router-dom";
import { ScrollToTop } from "./components/ScrollToTop";
2025-04-17 16:53:23 -05:00
2025-06-01 16:26:09 -05:00
// Lazy load page components
const Index = lazy(() => import("./pages/Index"));
const NotFound = lazy(() => import("./pages/NotFound"));
2025-04-17 16:53:23 -05:00
export function AppRouter() {
return (
<BrowserRouter>
<ScrollToTop />
2025-04-17 16:53:23 -05:00
<Routes>
<Route path="/" element={<Index />} />
{/* ADD ALL CUSTOM ROUTES ABOVE THE CATCH-ALL "*" ROUTE */}
<Route path="*" element={<NotFound />} />
</Routes>
</BrowserRouter>
);
}
export default AppRouter;