Skip to content

Commit

Permalink
fix: remove generic parameter.
Browse files Browse the repository at this point in the history
  • Loading branch information
Brokyeom committed Nov 20, 2024
1 parent 4a949e7 commit b7a4aad
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/ui/Input/TextField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@ import { type ReactNode, type InputHTMLAttributes, forwardRef } from 'react';
import { FieldBox } from 'FieldBox';
import * as S from './style.css';

interface TextFieldProps<T> extends Omit<InputHTMLAttributes<HTMLInputElement>, 'value'> {
interface TextFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'value'> {
className?: string;
topAddon?: ReactNode;
bottomAddon?: ReactNode;
labelText?: string;
descriptionText?: string;
required?: boolean;
errorMessage?: string;
value?: T;
value?: string | number;
// isError -> validationFn 순서로 적용
isError?: boolean;
validationFn?: (input: T) => boolean;
validationFn?: (input: string | number) => boolean;
}

const TextField = forwardRef<HTMLInputElement, TextFieldProps<string | number>>((props, forwardedRef) => {
const TextField = forwardRef<HTMLInputElement, TextFieldProps>((props, ref) => {
const {
className,
topAddon,
Expand Down Expand Up @@ -47,7 +47,7 @@ const TextField = forwardRef<HTMLInputElement, TextFieldProps<string | number>>(
/>
}
className={className}
ref={forwardedRef}
ref={ref}
topAddon={
labelText || descriptionText ? (
<FieldBox.Label description={descriptionText} label={labelText} required={required} />
Expand Down

0 comments on commit b7a4aad

Please sign in to comment.