Skip to content

Commit

Permalink
chore(git): merge main into dev (#845)
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusfg7 authored Mar 9, 2024
2 parents 8079328 + 82003e3 commit 333d789
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions content/til/2024_03_09-supress_hydration_warning_on_nextjs.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: 'Supress hydration warning on Next.js'
description: 'Supress "Text content does not match server-rendered HTML"'
date: '2024-03-09'
tags: [next.js,javascript,workaround,errors]
---

Just use `suppressHydrationWarning` on the component that is causing the warning:

```tsx
<time datetime="2016-10-25" suppressHydrationWarning />
```
2 changes: 1 addition & 1 deletion src/app/blog/til/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const metadata: Metadata = {

const TILComponent = ({ til }: { til: TIL }) => {
return (
<div className="relative flex flex-col gap-6 border-b border-b-neutral-200 py-12 last:border-none dark:border-b-neutral-800 md:flex-row md:gap-1">
<div className="relative flex flex-col gap-6 border-b border-b-neutral-200 py-12 last:border-none dark:border-b-neutral-800 md:flex-row md:gap-3">
<div className="top-24 h-fit flex-1 space-y-2 md:sticky md:space-y-5">
<div className="space-y-3">
<h2 className="text-xl font-bold">{til.title}</h2>
Expand Down

0 comments on commit 333d789

Please sign in to comment.