From 8ead0d00f5e5e81673d1647d79929138c49604da Mon Sep 17 00:00:00 2001 From: UnknownRori <68576836+UnknownRori@users.noreply.github.com> Date: Sun, 27 Aug 2023 17:51:49 +0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=80=20Implement=20Lazy=20Loading=20for?= =?UTF-8?q?=20`Router`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.tsx | 8 ++-- src/components/animation/LoadingSpinner.tsx | 10 +++++ src/components/navigation/RouterView.tsx | 42 +++++++++++++++++++++ src/router/router.tsx | 10 +++-- 4 files changed, 63 insertions(+), 7 deletions(-) create mode 100644 src/components/animation/LoadingSpinner.tsx create mode 100644 src/components/navigation/RouterView.tsx diff --git a/src/App.tsx b/src/App.tsx index 5c9b4c4..8002e1c 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -2,6 +2,7 @@ import Background from "@/components/animation/Background"; import Footer from '@/components/navigation/Footer'; import Navbar from '@/components/navigation/Navbar'; import Sidebar from '@/components/navigation/Sidebar'; +import RouterView from "@/components/navigation/RouterView"; import useRoute, { RouterContext } from "@/hooks/useRoute"; import router from "@/router/router"; @@ -16,10 +17,11 @@ export default function App() { + - <> - {currentPage} - + + +