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:
@@ -13,6 +13,7 @@ import packages from '../content/packages';
|
||||
import testimonials from '../content/testimonials';
|
||||
import siteContent from '../content/siteContent';
|
||||
import { visibleSocials } from '../lib/visibleSocials';
|
||||
import useHydrated from '../hooks/useHydrated';
|
||||
import { pageHead } from '../seo';
|
||||
|
||||
// ?pakket= from a "Boek" link on a price card. Only text is kept; whether it
|
||||
@@ -28,7 +29,10 @@ export const Route = createFileRoute('/')({
|
||||
|
||||
// The homepage: the hero, then the sections in the order of LAYOUT.md
|
||||
function Index() {
|
||||
const { pakket } = Route.useSearch();
|
||||
const { pakket: searched } = Route.useSearch();
|
||||
// The search only counts after hydration, so the prerendered HTML and the
|
||||
// first browser render agree (BR-HYD-10)
|
||||
const pakket = useHydrated() ? searched : undefined;
|
||||
// Without a valid https link the tiles would lead nowhere: no section
|
||||
const instagram = visibleSocials(siteContent.socials).find(
|
||||
(social) => social.platform === 'instagram',
|
||||
|
||||
Reference in New Issue
Block a user