From 48500e6bf20e1b39d5791eef659200d022fb0276 Mon Sep 17 00:00:00 2001 From: Barsnes Date: Thu, 28 Nov 2024 09:09:16 +0100 Subject: [PATCH] suppressHydrationWarning --- .../src/CodeSnippet/CodeSnippet.tsx | 6 ++- apps/_components/src/logos/Udir.tsx | 2 +- .../_components/PostLayout/PostLayout.tsx | 2 +- .../for-utviklere/komposisjon/page.mdx | 37 ++++++++----------- apps/storefront/app/komponenter/page.tsx | 2 +- .../layouts/MenuPageLayout/MenuPageLayout.tsx | 2 +- 6 files changed, 24 insertions(+), 27 deletions(-) diff --git a/apps/_components/src/CodeSnippet/CodeSnippet.tsx b/apps/_components/src/CodeSnippet/CodeSnippet.tsx index 9bb4ad2e6d..bf00ef571e 100644 --- a/apps/_components/src/CodeSnippet/CodeSnippet.tsx +++ b/apps/_components/src/CodeSnippet/CodeSnippet.tsx @@ -27,7 +27,7 @@ const plugins = [ ]; type CodeSnippetProps = { - language?: 'css' | 'html' | 'ts' | 'markdown' | 'json' | 'shell'; + language?: 'css' | 'html' | 'ts' | 'markdown' | 'json' | 'shell' | 'tsx'; children: string; } & React.HTMLAttributes; @@ -47,7 +47,8 @@ const CodeSnippet = ({ ) { try { const formatted = await format(children, { - parser: language === 'ts' ? 'babel-ts' : language, + parser: + language === 'ts' || language === 'tsx' ? 'babel-ts' : language, plugins, }); setSnippet(formatted); @@ -74,6 +75,7 @@ const CodeSnippet = ({
{snippet && ( diff --git a/apps/_components/src/logos/Udir.tsx b/apps/_components/src/logos/Udir.tsx index f2bc095722..33348d08d6 100644 --- a/apps/_components/src/logos/Udir.tsx +++ b/apps/_components/src/logos/Udir.tsx @@ -10,7 +10,7 @@ export function Udir(rest: UdirProps) { > Utdanningsdirektoratet logo -