Skip to content

Commit

Permalink
chore(website): Supress hydration for markdown
Browse files Browse the repository at this point in the history
Enabling StrictMode causes the renderers to run twice so the
client ids have been "seen" once more than the server. This
causes the ids to be off by one -_-
  • Loading branch information
mlaursen committed Jan 18, 2022
1 parent 3203af4 commit 8bb4d51
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/documentation/src/components/Markdown/renderers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const renderers: MarkdownRenderers = {

const id = useSluggedId(tokens);
return (
<Typography id={id} type={type}>
<Typography id={id} type={type} suppressHydrationWarning>
{children}
</Typography>
);
Expand Down Expand Up @@ -112,7 +112,11 @@ export const renderers: MarkdownRenderers = {
// checked state instead of clicking the checkbox. Only useful if the
// preview is persistent while updating the markdown.
return (
<li key={`${defaultChecked}`} className={styles.task}>
<li
key={`${defaultChecked}`}
className={styles.task}
suppressHydrationWarning
>
<Checkbox id={id} defaultChecked={defaultChecked} label={children} />
</li>
);
Expand Down

0 comments on commit 8bb4d51

Please sign in to comment.