From 4a86910e6698c1269d60b3f71358b8bcc189fbd8 Mon Sep 17 00:00:00 2001 From: Madhura68 Date: Tue, 5 May 2026 13:29:43 +0200 Subject: [PATCH] fix(m12): hydration mismatch on IdeaTimeline timestamps \`new Date(...).toLocaleString()\` zonder expliciete locale gebruikt de default-locale van runtime: server (Node) levert nl-NL formaat (\`05/05/2026, 13:21:51\`), browser CSR levert en-US (\`5/5/2026, 1:21:51 PM\`). React detecteert dat als hydration-mismatch en regenereert de tree. Fix: pass \`'nl-NL'\` met expliciete date/time-style. Server en client produceren nu identieke output. Co-Authored-By: Claude Opus 4.7 (1M context) --- components/ideas/idea-timeline.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/components/ideas/idea-timeline.tsx b/components/ideas/idea-timeline.tsx index 81a506b..133e176 100644 --- a/components/ideas/idea-timeline.tsx +++ b/components/ideas/idea-timeline.tsx @@ -100,7 +100,12 @@ export function IdeaTimeline({ logs, questions }: Props) { return (
    {merged.map((entry, i) => { - const time = new Date(entry.created_at).toLocaleString() + // Expliciete locale + format om SSR/CSR hydration-mismatch te voorkomen + // (server-locale verschilde van browser-locale). + const time = new Date(entry.created_at).toLocaleString('nl-NL', { + dateStyle: 'short', + timeStyle: 'short', + }) if (entry.kind === 'log') { const type = entry.data.type as IdeaLogType