Skip to content

Commit c761e44

Browse files
committed
Fix 404 on page refresh by switching to HashRouter
- Changed from BrowserRouter to HashRouter to prevent 404 errors on refresh - URLs will now use hash-based routing (e.g., /#/about)
1 parent 5fb8656 commit c761e44

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import React from 'react'
22
import ReactDOM from 'react-dom/client'
3-
import { BrowserRouter } from 'react-router-dom'
3+
import { HashRouter } from 'react-router-dom'
44
import App from './App'
55
import './styles/index.css'
66

77
ReactDOM.createRoot(document.getElementById('root')!).render(
88
<React.StrictMode>
9-
<BrowserRouter>
9+
<HashRouter>
1010
<App />
11-
</BrowserRouter>
11+
</HashRouter>
1212
</React.StrictMode>,
1313
)

0 commit comments

Comments
 (0)