-
-
Notifications
You must be signed in to change notification settings - Fork 747
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: notFound handling in notFound when SSRing (#3283)
- Loading branch information
1 parent
0a2e9aa
commit 8442ef5
Showing
10 changed files
with
319 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { Link, createFileRoute } from '@tanstack/react-router' | ||
|
||
export const Route = createFileRoute('/not-found/')({ | ||
component: () => { | ||
const preload = Route.useSearch({ select: (s) => s.preload }) | ||
return ( | ||
<div> | ||
<div className="mb-2"> | ||
<Link | ||
from={Route.fullPath} | ||
to="./via-beforeLoad" | ||
preload={preload} | ||
data-testid="via-beforeLoad" | ||
> | ||
via-beforeLoad | ||
</Link> | ||
</div> | ||
<div className="mb-2"> | ||
<Link | ||
from={Route.fullPath} | ||
to="./via-loader" | ||
preload={preload} | ||
data-testid="via-loader" | ||
> | ||
via-loader | ||
</Link> | ||
</div> | ||
</div> | ||
) | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { createFileRoute } from '@tanstack/react-router' | ||
import z from 'zod' | ||
|
||
export const Route = createFileRoute('/not-found')({ | ||
validateSearch: z.object({ | ||
preload: z.literal(false).optional(), | ||
}), | ||
}) |
Oops, something went wrong.