Skip to content

Commit

Permalink
[TM-786] Fix some generic typing.
Browse files Browse the repository at this point in the history
  • Loading branch information
roguenet committed May 28, 2024
1 parent 4f54959 commit 4ba0d87
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/elements/Text/Text.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import cn from "classnames";
import _ from "lodash";
import { ForwardedRef, forwardRef, HTMLProps, ReactElement, ReactNode, Ref } from "react";
import { ForwardedRef, forwardRef, HTMLProps, LegacyRef, ReactElement, ReactNode } from "react";

import { TextVariants } from "@/types/common";

Expand All @@ -13,7 +13,7 @@ export type TextProps<T = HTMLParagraphElement> = HTMLProps<T> & {
capitalize?: boolean;
};

function Text<T>(props: TextProps<T>, ref: ForwardedRef<unknown>): JSX.Element {
function Text<T>(props: TextProps<T>, ref: ForwardedRef<T>): JSX.Element {
const { as: As, className, children, variant, capitalize, containHtml, ...rest } = props;

const Component = As || "p";
Expand All @@ -37,4 +37,4 @@ function Text<T>(props: TextProps<T>, ref: ForwardedRef<unknown>): JSX.Element {
);
}

export default forwardRef(Text) as <T>(p: TextProps<T> & { ref?: Ref<unknown> }) => ReactElement;
export default forwardRef(Text) as <T>(p: TextProps<T> & { ref?: LegacyRef<T> }) => ReactElement;

0 comments on commit 4ba0d87

Please sign in to comment.