Skip to content

Commit

Permalink
fix(blog): hydration error on date (#8871)
Browse files Browse the repository at this point in the history
SSR renders an en-US format date, client side renders in the user's locale
  • Loading branch information
LeoMcA authored May 16, 2023
1 parent 8b8ae3d commit a271858
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion client/src/blog/post.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export function TimeToRead({ readTime }: { readTime: number | undefined }) {

export function PublishDate({ date }: { date: string }) {
return (
<time className="date">
<time className="date" suppressHydrationWarning>
{Intl.DateTimeFormat(undefined, { dateStyle: "long" }).format(
new Date(date)
)}
Expand Down

0 comments on commit a271858

Please sign in to comment.