Skip to content

Commit cd6f0df

Browse files
Replace 404 Go home with matches link
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
1 parent 607ddeb commit cd6f0df

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

app/components/errors.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,12 @@ function ErrorPage({
103103
) : null}
104104
<HeroSection {...heroProps} />
105105

106+
{possibleMatchesQuery && !possibleMatches?.length ? (
107+
// Ensure in-page links to `#possible-matches` have a target even
108+
// before semantic results load.
109+
<div id="possible-matches" />
110+
) : null}
111+
106112
{possibleMatches?.length ? (
107113
<PossibleMatchesSection
108114
matches={possibleMatches}
@@ -270,7 +276,7 @@ function FourOhFour({
270276
title: "404 - Oh no, you found a page that's missing stuff.",
271277
subtitle: `"${pathname}" is not a page on kentcdodds.com. So sorry.`,
272278
image: <MissingSomething className="rounded-lg" aspectRatio="3:4" />,
273-
action: <ArrowLink href="/">Go home</ArrowLink>,
279+
action: <ArrowLink to="#possible-matches">Possible matches</ArrowLink>,
274280
}}
275281
/>
276282
)

0 commit comments

Comments
 (0)