Skip to content

Commit

Permalink
fix: 새로고침 에러 수정 작업 #7
Browse files Browse the repository at this point in the history
계속되는 오류로 HashRouter로 임시 처리
  • Loading branch information
ldhbenecia committed Sep 27, 2023
1 parent e12eef8 commit 08826bb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import { BrowserRouter as Router, Routes, Route } from "react-router-dom";
import { BrowserRouter as Router, Routes, Route, HashRouter } from "react-router-dom";
import RealMain from "./pages/Main/RealMain";
import About from "./pages/About/About";
import Teams from "./pages/Teams/Teams";
Expand All @@ -11,7 +11,7 @@ import Activity from "./pages/Activity/Activity";

function App() {
return (
<Router basename={process.env.PUBLIC_URL}>
<HashRouter>
<Routes>
<Route path="/" element={<RealMain />} />
<Route path="/about" element={<About />} />
Expand All @@ -22,7 +22,7 @@ function App() {
<Route path="/TeamsHufsSpetition" element={<TeamsHufsSpetition />} />
<Route path="/recruit" element={<Recruit />} />
</Routes>
</Router>
</HashRouter>
);
}

Expand Down
7 changes: 4 additions & 3 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ import React from "react";
import ReactDOM from "react-dom/client";
import App from "./App";
import "./styles/styles.css";
import { HashRouter } from "react-router-dom";

const root = ReactDOM.createRoot(document.getElementById("root") as HTMLElement);
root.render(
<React.StrictMode>
<App />
</React.StrictMode>
<React.StrictMode>
<App />
</React.StrictMode>
);

0 comments on commit 08826bb

Please sign in to comment.