From a740bc6a19266a5f9bdf95d3f58d6950fa29e2e8 Mon Sep 17 00:00:00 2001 From: Lukas Harbarth Date: Mon, 1 Jul 2024 12:53:23 +0200 Subject: [PATCH 1/2] fix(CommonProps - TypeScript): remove `dangerouslySetInnerHTML` from types BREAKING CHANGE: `dangerouslySetInnerHTML` type has been removed --- docs/MigrationGuide.mdx | 5 +++++ packages/main/src/types/CommonProps.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/MigrationGuide.mdx b/docs/MigrationGuide.mdx index e0658393481..47159ffae0f 100644 --- a/docs/MigrationGuide.mdx +++ b/docs/MigrationGuide.mdx @@ -38,6 +38,11 @@ function MyRootComponent() { } ``` +### Changes Exclusive to TypeScript + +- Removed `dangerouslySetInnerHTML` from general prop types since it was never intended to be used with our library. + If you've previously used this prop and the component didn't change with the update, then it might still work, but you'll probably need to suppress the typescript error. + ## Removed hooks ### `useResponsiveContentPadding` diff --git a/packages/main/src/types/CommonProps.ts b/packages/main/src/types/CommonProps.ts index f2f2cf37732..605bf1b6963 100644 --- a/packages/main/src/types/CommonProps.ts +++ b/packages/main/src/types/CommonProps.ts @@ -1,6 +1,6 @@ import type { CSSProperties, HTMLAttributes } from 'react'; -export interface CommonProps extends HTMLAttributes { +export interface CommonProps extends Omit, 'dangerouslySetInnerHTML'> { /** * Element style which will be appended to the most outer element of a component. * Use this prop carefully, some css properties might break the component. From 3c3cbf6b64434e568a7ff30b1bfe4ad2247a596a Mon Sep 17 00:00:00 2001 From: Marcus Notheis Date: Mon, 1 Jul 2024 13:12:52 +0200 Subject: [PATCH 2/2] Update MigrationGuide.mdx --- docs/MigrationGuide.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/MigrationGuide.mdx b/docs/MigrationGuide.mdx index 47159ffae0f..3eecfc0d26d 100644 --- a/docs/MigrationGuide.mdx +++ b/docs/MigrationGuide.mdx @@ -41,7 +41,7 @@ function MyRootComponent() { ### Changes Exclusive to TypeScript - Removed `dangerouslySetInnerHTML` from general prop types since it was never intended to be used with our library. - If you've previously used this prop and the component didn't change with the update, then it might still work, but you'll probably need to suppress the typescript error. + If you've previously used this prop and the component didn't change with the update, then it might still work, but you'll probably need to suppress the TypeScript error. ## Removed hooks