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) <noreply@anthropic.com>
This commit is contained in:
parent
4daa564811
commit
4a86910e66
1 changed files with 6 additions and 1 deletions
|
|
@ -100,7 +100,12 @@ export function IdeaTimeline({ logs, questions }: Props) {
|
||||||
return (
|
return (
|
||||||
<ol className="border-l-2 border-input pl-4 space-y-3 ml-2">
|
<ol className="border-l-2 border-input pl-4 space-y-3 ml-2">
|
||||||
{merged.map((entry, i) => {
|
{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') {
|
if (entry.kind === 'log') {
|
||||||
const type = entry.data.type as IdeaLogType
|
const type = entry.data.type as IdeaLogType
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue