diff --git a/apps/journal/app/components/ClientDate.tsx b/apps/journal/app/components/ClientDate.tsx index 0bbc775..af210ae 100644 --- a/apps/journal/app/components/ClientDate.tsx +++ b/apps/journal/app/components/ClientDate.tsx @@ -1,20 +1,12 @@ -import { useState, useEffect } from "react"; import { useLocale } from "./LocaleContext"; /** - * Renders a date using the server-detected locale for the initial render - * (matching SSR output), then updates to the browser's native locale - * after hydration. + * Renders a date formatted with the server-detected locale, + * ensuring SSR and client output match (no hydration flicker). */ export function ClientDate({ iso }: { iso: string }) { const locale = useLocale(); - const [formatted, setFormatted] = useState( - new Date(iso).toLocaleDateString(locale), + return ( + ); - - useEffect(() => { - setFormatted(new Date(iso).toLocaleDateString()); - }, [iso]); - - return ; }