Skip to content

Commit

Permalink
refactor: options의 value가 string도 받을 수 있게 타입 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
grapefruit13 committed Mar 21, 2024
1 parent b5cc91e commit 5a4e4c6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/commons/inputs/FormDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const { url: activeUrl, alt: activeAlt } = SVGS.arrow.down.active;

type FormDropdownProps = {
name: string;
options: { title: string; value: number }[];
options: { title: string; value: number | string }[];
label?: string;
isSmall?: boolean;
isDisabled?: boolean;
Expand All @@ -29,7 +29,7 @@ export const FormDropdown = ({ name, label = '', options, isSmall = false, isDis
const { isOpen, popupRef, buttonRef, togglePopup } = useTogglePopup();
const [currentOptionTitle, setCurrentOptionTitle] = useState(options[0].title);

const handleOptionChange = (title: string, value: number) => {
const handleOptionChange = (title: string, value: number | string) => {
setValue(name, value);
setCurrentOptionTitle(title);
togglePopup();
Expand Down

0 comments on commit 5a4e4c6

Please sign in to comment.