Skip to content

Commit a8fe56e

Browse files
starpitjgchn
authored andcommitted
fix: switch ui to HashRouter so that /index.html and nested page reloads work on hosted sites
Signed-off-by: Nick Mitchell <[email protected]>
1 parent 6ea28c0 commit a8fe56e

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

pdl-live-react/src/main.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { StrictMode } from "react"
22
import { createRoot } from "react-dom/client"
3-
import { BrowserRouter } from "react-router"
3+
import { HashRouter as Router } from "react-router"
44
import App from "./App.tsx"
55

66
createRoot(document.getElementById("root")!).render(
77
<StrictMode>
8-
<BrowserRouter>
8+
<Router>
99
<App />
10-
</BrowserRouter>
10+
</Router>
1111
</StrictMode>,
1212
)

pdl-live-react/tests/basics.spec.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { join } from "path"
22
import { test, expect } from "@playwright/test"
33
;[
4-
{ path: "", title: /Viewer/ },
5-
{ path: "welcome", title: /Welcome/ },
6-
{ path: "about", title: /About/ },
7-
{ path: "upload", title: /Upload/ },
8-
{ path: "demos/Fibonacci", title: /Fibonacci/ },
4+
{ path: "#", title: /Viewer/ },
5+
{ path: "#welcome", title: /Welcome/ },
6+
{ path: "#about", title: /About/ },
7+
{ path: "#upload", title: /Upload/ },
8+
{ path: "#demos/Fibonacci", title: /Fibonacci/ },
99
].forEach(({ path, title }) =>
1010
test(`${path} has title ${title}`, async ({ page }) => {
1111
await page.goto(join("http://localhost:1420", path))

0 commit comments

Comments
 (0)