Skip to content

Commit

Permalink
fix(Text): fix custom html tag inheritance
Browse files Browse the repository at this point in the history
  • Loading branch information
chelentos committed May 15, 2024
1 parent 33de0a0 commit 0f7b9d1
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/components/Text/Text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<C extends React.ElementType>
extends Omit<TextBaseProps, 'ellipsisLines'>,
ColorTextBaseProps,
QAProps {
/**
* Ability to override default html tag
*/
as?: keyof JSX.IntrinsicElements;
as?: C;
style?: React.CSSProperties;
className?: string;
id?: string;
Expand All @@ -25,9 +25,8 @@ export interface TextProps

type TextRef<C extends React.ElementType> = React.ComponentPropsWithRef<C>['ref'];

type TextPropsWithoutRef<C extends React.ElementType> = {
as?: C;
} & Omit<TextProps, 'as'>;
type TextPropsWithoutRef<C extends React.ElementType> = TextProps<C> &
Omit<React.ComponentPropsWithoutRef<C>, keyof TextProps<C>>;

/**
* A component for working with typography.
Expand Down

0 comments on commit 0f7b9d1

Please sign in to comment.