From ca695b12a15aa913919945f447d4d9a970bf8e9e Mon Sep 17 00:00:00 2001 From: Rihan Date: Tue, 13 Dec 2022 22:50:36 +0000 Subject: [PATCH] Remove forwardRef --- src/components/Dropdown.tsx | 88 ++++++++++++++++++------------------- 1 file changed, 43 insertions(+), 45 deletions(-) diff --git a/src/components/Dropdown.tsx b/src/components/Dropdown.tsx index d0bd882f..9ebef561 100644 --- a/src/components/Dropdown.tsx +++ b/src/components/Dropdown.tsx @@ -14,48 +14,46 @@ interface DropdownProps { options: Array; } -export const Dropdown = React.forwardRef( - (props: DropdownProps) => ( -
- - {({ open }) => ( - <> - - {props.selectedItem.name} - - - - - - - {props.options.map((opt) => ( - - `relative cursor-default select-none py-2 pl-10 pr-4 ${ - active ? "bg-denim-400 text-bink-700" : "text-white" - }` - } - key={opt.id} - value={opt} - > - {opt.name} - - ))} - - - - )} - -
- ) -); +export function Dropdown(props: DropdownProps) { +
+ + {({ open }) => ( + <> + + {props.selectedItem.name} + + + + + + + {props.options.map((opt) => ( + + `relative cursor-default select-none py-2 pl-10 pr-4 ${ + active ? "bg-denim-400 text-bink-700" : "text-white" + }` + } + key={opt.id} + value={opt} + > + {opt.name} + + ))} + + + + )} + +
; +}