From 23a394643dfd97a437cc83d3a0c3c8feeaa3c3ba Mon Sep 17 00:00:00 2001 From: keannu125 Date: Sat, 25 Mar 2023 13:00:36 +0800 Subject: [PATCH] Move to hash router and change url accordingly --- package.json | 2 +- src/index.tsx | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 99d504e..8e330c8 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "react-notes", "version": "0.1.0", "private": true, - "homepage": "https://lemeow125.github.io/react-notes", + "homepage": "https://lemeow125.github.io/react-notes/#", "dependencies": { "@emotion/react": "^11.10.6", "@emotion/styled": "^11.10.6", diff --git a/src/index.tsx b/src/index.tsx index 04f137a..8a1d3c6 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -2,7 +2,11 @@ import React from "react"; import ReactDOM from "react-dom/client"; import "./index.css"; import reportWebVitals from "./reportWebVitals"; -import { createBrowserRouter, RouterProvider } from "react-router-dom"; +import { + createBrowserRouter, + createHashRouter, + RouterProvider, +} from "react-router-dom"; import Home from "./Routes/Home/Home"; import NewNote from "./Routes/NewNote/NewNote"; @@ -19,7 +23,7 @@ import Store from "./Features/Redux/Store/Store"; const queryClient = new QueryClient(); -const router = createBrowserRouter([ +const router = createHashRouter([ { path: "/", element: ,