Skip to content

Commit

Permalink
Configure react-router to work with gh-pages 🫱🏽‍🫲🏾.
Browse files Browse the repository at this point in the history
  • Loading branch information
gmarty committed Apr 17, 2024
1 parent dbdf291 commit 7af88f8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import { createRoot } from 'react-dom/client';
import { BrowserRouter } from 'react-router-dom';
import { HashRouter } from 'react-router-dom';
import App from './App';

const basename =
process.env.NODE_ENV === 'development' ? undefined : '/scumm-nes';

const root = createRoot(document.body);
root.render(
<BrowserRouter>
<HashRouter basename={basename}>
<App />
</BrowserRouter>,
</HashRouter>,
);

0 comments on commit 7af88f8

Please sign in to comment.