Skip to content

Commit 4fd8566

Browse files
Move Away From Full Page Load (#243)
1 parent 369c926 commit 4fd8566

5 files changed

Lines changed: 11 additions & 7 deletions

File tree

packages/app-next-js/app/mpa/page.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import Link from 'next/link'
12
import { testData } from '../../../testdata/src/ssr'
23

34
export const dynamic = 'force-dynamic'
@@ -13,7 +14,7 @@ export default async function MpaPage() {
1314
<td>{entry.id}</td>
1415
<td>{entry.name}</td>
1516
<td>
16-
<a href={`/mpa/${entry.id}`}>View →</a>
17+
<Link href={`/mpa/${entry.id}`}>View →</Link>
1718
</td>
1819
</tr>
1920
))}

packages/app-react-router/app/routes/mpa.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { Link } from 'react-router'
12
import { testData } from '../../../testdata/src/ssr'
23
import type { Route } from './+types/mpa'
34

@@ -15,7 +16,7 @@ export default function MpaPage({ loaderData }: Route.ComponentProps) {
1516
<td>{entry.id}</td>
1617
<td>{entry.name}</td>
1718
<td>
18-
<a href={`/mpa/${entry.id}`}>View →</a>
19+
<Link to={`/mpa/${entry.id}`}>View →</Link>
1920
</td>
2021
</tr>
2122
))}

packages/app-solid-start/src/routes/mpa/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { For } from 'solid-js'
2-
import { query, createAsync } from '@solidjs/router'
2+
import { A, query, createAsync } from '@solidjs/router'
33
import { testData } from '../../../../testdata/src/ssr'
44

55
const getData = query(async () => {
@@ -23,7 +23,7 @@ export default function MpaPage() {
2323
<td>{entry.id}</td>
2424
<td>{entry.name}</td>
2525
<td>
26-
<a href={`/mpa/${entry.id}`}>View →</a>
26+
<A href={`/mpa/${entry.id}`}>View →</A>
2727
</td>
2828
</tr>
2929
)}

packages/app-sveltekit/src/routes/mpa/+page.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<td>{entry.id}</td>
1010
<td>{entry.name}</td>
1111
<td>
12-
<a href="/mpa/{entry.id}" data-sveltekit-reload>View →</a>
12+
<a href="/mpa/{entry.id}">View →</a>
1313
</td>
1414
</tr>
1515
{/each}

packages/app-tanstack-start-react/src/routes/mpa.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { createFileRoute } from '@tanstack/react-router'
1+
import { createFileRoute, Link } from '@tanstack/react-router'
22
import { testData } from '../../../testdata/src/ssr'
33

44
export const Route = createFileRoute('/mpa')({
@@ -17,7 +17,9 @@ function MpaPage() {
1717
<td>{entry.id}</td>
1818
<td>{entry.name}</td>
1919
<td>
20-
<a href={`/mpa/${entry.id}`}>View →</a>
20+
<Link to="/mpa/$id" params={{ id: entry.id }}>
21+
View →
22+
</Link>
2123
</td>
2224
</tr>
2325
))}

0 commit comments

Comments
 (0)