From 8a35707cf0431d00e5728cffc290b9e1b2c8092b Mon Sep 17 00:00:00 2001 From: hamo-o Date: Sat, 24 Aug 2024 22:49:20 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20dropdownId=20useDropDownState=EC=97=90?= =?UTF-8?q?=EC=84=9C=20=EC=82=AD=EC=A0=9C,=20=EB=94=B0=EB=A1=9C=20?= =?UTF-8?q?=EB=84=98=EA=B2=A8=EC=A3=BC=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/DropDown/context/DropDownContext.ts | 6 +++--- packages/wow-ui/src/components/DropDown/index.tsx | 3 +-- packages/wow-ui/src/hooks/useDropDownState.ts | 3 --- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/packages/wow-ui/src/components/DropDown/context/DropDownContext.ts b/packages/wow-ui/src/components/DropDown/context/DropDownContext.ts index 09d53349..7757ad7f 100644 --- a/packages/wow-ui/src/components/DropDown/context/DropDownContext.ts +++ b/packages/wow-ui/src/components/DropDown/context/DropDownContext.ts @@ -3,9 +3,9 @@ import { createContext } from "react"; import type useDropDownState from "../../../hooks/useDropDownState"; import useSafeContext from "../../../hooks/useSafeContext"; -export const DropDownContext = createContext | null>(null); +export const DropDownContext = createContext< + (ReturnType & { dropdownId: string }) | null +>(null); export const useDropDownContext = () => { const context = useSafeContext(DropDownContext); diff --git a/packages/wow-ui/src/components/DropDown/index.tsx b/packages/wow-ui/src/components/DropDown/index.tsx index 56743aff..47cf5803 100644 --- a/packages/wow-ui/src/components/DropDown/index.tsx +++ b/packages/wow-ui/src/components/DropDown/index.tsx @@ -97,11 +97,10 @@ const DropDown = ({ value, defaultValue, onChange, - dropdownId, }); return ( - + void; - dropdownId?: string; } const useDropDownState = ({ value, defaultValue, onChange, - dropdownId, }: DropDownStateProps) => { const [selectedValue, setSelectedValue] = useState(""); const [open, setOpen] = useState(false); @@ -47,7 +45,6 @@ const useDropDownState = ({ focusedValue, setFocusedValue, handleSelect, - dropdownId, }; };