Skip to content

Commit 71ed929

Browse files
fix: use hashrouter so it works in gh pages
1 parent 6d2b7cb commit 71ed929

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ import Contribute from "./pages/Contribute";
77
import DCPage from "./pages/DCPage";
88
import Projects from "./pages/Projects";
99
import reportWebVitals from "./tests/reportWebVitals";
10-
import { BrowserRouter, Routes, Route, Navigate } from "react-router-dom";
10+
import { Routes, Route, Navigate, HashRouter } from "react-router-dom";
1111

1212
const root = ReactDOM.createRoot(
1313
document.getElementById("root") as HTMLElement
1414
);
1515

1616
root.render(
17-
<BrowserRouter>
17+
<HashRouter>
1818
<Routes>
1919
<Route path="/" element={<Navigate to="/about" replace />} />
2020
<Route path="/" element={<App />}>
@@ -24,7 +24,7 @@ root.render(
2424
<Route path="/dc" element={<DCPage />} />
2525
</Route>
2626
</Routes>
27-
</BrowserRouter>
27+
</HashRouter>
2828
);
2929

3030
// If you want to start measuring performance in your app, pass a function

0 commit comments

Comments
 (0)