From fcd2ff33a7875c84a76fdab757a474d42f900b3e Mon Sep 17 00:00:00 2001 From: Andrey Timofeev Date: Wed, 15 May 2024 17:28:47 +0300 Subject: [PATCH] fix(Text): fix custom html tag inheritance (#1584) --- src/components/Text/Text.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/components/Text/Text.tsx b/src/components/Text/Text.tsx index d78f42ecbf..ca511f1598 100644 --- a/src/components/Text/Text.tsx +++ b/src/components/Text/Text.tsx @@ -7,14 +7,14 @@ import type {ColorTextBaseProps} from './colorText/colorText'; import {text} from './text/text'; import type {TextBaseProps} from './text/text'; -export interface TextProps +export interface TextProps extends Omit, ColorTextBaseProps, QAProps { /** * Ability to override default html tag */ - as?: keyof JSX.IntrinsicElements; + as?: C; style?: React.CSSProperties; className?: string; id?: string; @@ -25,9 +25,8 @@ export interface TextProps type TextRef = React.ComponentPropsWithRef['ref']; -type TextPropsWithoutRef = { - as?: C; -} & Omit; +type TextPropsWithoutRef = TextProps & + Omit, keyof TextProps>; /** * A component for working with typography.