Skip to content

Commit 7c92d53

Browse files
committed
Fix React Router basename for GitHub Pages deployment
1 parent 9f07ea0 commit 7c92d53

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

demo/public/404.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<script>
1111
// GitHub Pages SPA redirect
1212
// Redirect to the main demo page and let React Router handle the routing
13-
var segmentCount = 1; // Number of path segments to keep (/demo/)
13+
var segmentCount = 2; // Number of path segments to keep (/Needle/demo/)
1414
var l = window.location;
1515
l.replace(
1616
l.protocol + '//' + l.hostname + (l.port ? ':' + l.port : '') +

demo/src/App.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function App() {
3535
console.log('Needle Demo App loading...');
3636

3737
return (
38-
<Router>
38+
<Router basename="/Needle/demo">
3939
<div className="App">
4040
<RedirectHandler />
4141
<Layout>

0 commit comments

Comments
 (0)