Makes the first render match the prerendered HTML
Search values, the 404 buttons and the footer year now apply after hydration. The e-mail address stays out of the HTML behind a placeholder, and all review texts are in the page, so crawlers can read them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { useRouterState } from '@tanstack/react-router';
|
||||
import useHydrated from '@/hooks/useHydrated';
|
||||
import { isShootSectionPath } from '@/lib/isShootSectionPath';
|
||||
import LinkButton from '../LinkButton';
|
||||
import StatusPage from './StatusPage';
|
||||
@@ -9,6 +10,9 @@ import StatusPage from './StatusPage';
|
||||
// Onder /soorten-fotoshoots/ komt er een knop naar het overzicht bij
|
||||
// (FR-ST-14).
|
||||
export default function NotFound() {
|
||||
// De prerender is gemaakt voor /404; het echte pad telt pas na de
|
||||
// hydratatie, anders verschilt de eerste render van de HTML (BR-404-04)
|
||||
const hydrated = useHydrated();
|
||||
const pathname = useRouterState({
|
||||
select: (routerState) => routerState.location.pathname,
|
||||
});
|
||||
@@ -20,7 +24,7 @@ export default function NotFound() {
|
||||
<StatusPage
|
||||
title="Pagina niet gevonden"
|
||||
actions={
|
||||
isShootSectionPath(pathname) ? (
|
||||
hydrated && isShootSectionPath(pathname) ? (
|
||||
<>
|
||||
<LinkButton
|
||||
to="/soorten-fotoshoots"
|
||||
|
||||
Reference in New Issue
Block a user