Skip to content

Commit

Permalink
fix: TextField value optional로 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Brokyeom committed Nov 18, 2024
1 parent a323944 commit ae4eef5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/ui/Input/TextField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface TextFieldProps<T> extends Omit<InputHTMLAttributes<HTMLInputElement>,
descriptionText?: string;
required?: boolean;
errorMessage?: string;
value: T;
value?: T;
// isError -> validationFn 순서로 적용
isError?: boolean;
validationFn?: (input: T) => boolean;
Expand All @@ -34,7 +34,7 @@ function TextField<T extends string | number>(props: TextFieldProps<T>) {
const hasError = () => {
if (inputProps.disabled || inputProps.readOnly) return false;
if (isError !== undefined) return isError;
if (validationFn && !validationFn(value)) return true;
if (validationFn && value && !validationFn(value)) return true;
return false;
};

Expand Down

0 comments on commit ae4eef5

Please sign in to comment.