Skip to content

Commit 04cf676

Browse files
authored
fix: repair the URL matching pattern to enable SSR on all pages (#32)
fixes #11
1 parent 526740b commit 04cf676

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/entry-server.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ import { PageWrapper } from './components/wrapper/PageWrapper.jsx';
1717
* @param {string} url
1818
* @param {import('react-dom/server').RenderToPipeableStreamOptions} [options]
1919
*/
20-
export function render(url, options) {
20+
export function render(_url, options) {
21+
const url = `/${_url}`;
22+
2123
const { pipe, abort } = renderToPipeableStream(
2224
<StrictMode>
2325
<StaticRouter location={url}>

src/routes/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export const Router = () => {
1414
return (
1515
<Routes>
1616
<Route index path="/" element={<Welcome />} />
17-
<Route index path="/dashboard/" element={<Dashboard />} />
17+
<Route index path="/dashboard" element={<Dashboard />} />
1818
</Routes>
1919
);
2020
};

0 commit comments

Comments
 (0)