Skip to content

Commit e0dab18

Browse files
committed
Use hash router
1 parent 5577271 commit e0dab18

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/App.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// App.jsx or App.tsx
2-
import { BrowserRouter as Router, Routes, Route } from 'react-router-dom'
2+
import { Routes, Route } from 'react-router-dom'
33
import Header from './components/Header'
44
import Footer from './components/Footer'
55
import Home from './pages/Home'
@@ -11,7 +11,6 @@ import Photos from './pages/Photos'
1111
import "./App.css"
1212
function App() {
1313
return (
14-
<Router>
1514
<>
1615
<Header />
1716
<main className="container">
@@ -26,7 +25,6 @@ function App() {
2625
</main>
2726
<Footer />
2827
</>
29-
</Router>
3028
)
3129
}
3230

src/main.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ import React from 'react'
22
import ReactDOM from 'react-dom/client'
33
import App from './App.tsx'
44
import './index.css'
5-
5+
import { HashRouter } from 'react-router-dom'
66
ReactDOM.createRoot(document.getElementById('root')!).render(
77
<React.StrictMode>
8+
<HashRouter>
89
<App />
10+
</HashRouter>
911
</React.StrictMode>,
1012
)

0 commit comments

Comments
 (0)