Last active
December 8, 2023 11:38
-
-
Save TheTharz/3fa5cd64f799bdc0941b87dc214f1646 to your computer and use it in GitHub Desktop.
Electronjs BrowserRouter not working properly
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Use hashRouter instead of the BrowserRouter | |
| import { HashRouter as Router, Routes, Route } from 'react-router-dom'; | |
| const root = ReactDOM.createRoot( | |
| document.getElementById('root') as HTMLElement | |
| ); | |
| root.render( | |
| <React.StrictMode> | |
| {/* <App /> */} | |
| <Router> | |
| <Routes> | |
| <Route path='/' element={<Layout />} /> | |
| </Routes> | |
| </Router> | |
| </React.StrictMode> | |
| ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment