Skip to content

Instantly share code, notes, and snippets.

@TheTharz
Last active December 8, 2023 11:38
Show Gist options
  • Select an option

  • Save TheTharz/3fa5cd64f799bdc0941b87dc214f1646 to your computer and use it in GitHub Desktop.

Select an option

Save TheTharz/3fa5cd64f799bdc0941b87dc214f1646 to your computer and use it in GitHub Desktop.
Electronjs BrowserRouter not working properly
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