Skip to content

Commit dad66a0

Browse files
committed
fix router for ghpages
1 parent b93a39f commit dad66a0

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

public/404.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<!-- filepath: public/404.html -->
2+
<script>
3+
var path = window.location.pathname;
4+
window.location.replace('/?redirect=' + encodeURIComponent(path));
5+
</script>

src/components/App.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export default class App extends React.Component {
3737
render() {
3838
return (
3939
<ThemeProvider theme={theme}>
40-
<Router>
40+
<Router basename="/">
4141
<Routes>
4242
<Route path="/" element={
4343
<AppProvider>

0 commit comments

Comments
 (0)