diff --git a/src/App.jsx b/src/App.jsx index a86158f..a2af1c2 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1,27 +1,29 @@ import { BrowserRouter as Router, Routes, Route } from 'react-router-dom'; +import { Suspense, lazy } from 'react'; import Navbar from './components/Navbar'; import Footer from './components/Footer'; -import Home from './pages/Home'; -import TopPicks from './pages/TopPicks'; -import ArtDescription from './pages/ArtDescription'; -import ErrorPage from './pages/Error'; +// Lazy loading of route components +const Home = lazy(() => import('./pages/Home')); +const TopPicks = lazy(() => import('./pages/TopPicks')); +const ArtDescription = lazy(() => import('./pages/ArtDescription')); +const ErrorPage = lazy(() => import('./pages/Error')); function App() { return (