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:
@@ -11,6 +11,7 @@ import contactContent from '../content/contactContent';
|
||||
import packages from '../content/packages';
|
||||
import siteContent from '../content/siteContent';
|
||||
import { withReplyTime } from '../lib/withReplyTime';
|
||||
import useHydrated from '../hooks/useHydrated';
|
||||
import { contactPage, pageHead, structuredDataScript } from '../seo';
|
||||
|
||||
// ?pakket= from a link elsewhere on the site. Only text is kept; the panel
|
||||
@@ -34,7 +35,10 @@ export const Route = createFileRoute('/contact')({
|
||||
// form (BR-CP-01..04). The card is in the page twice, one per layout, so the
|
||||
// reading order always matches what is shown.
|
||||
function Contact() {
|
||||
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;
|
||||
const navigate = useNavigate();
|
||||
const { head, formTitle, detailsTitle, image, portrait } = contactContent;
|
||||
const { email, socials, contactForm } = siteContent;
|
||||
|
||||
Reference in New Issue
Block a user