dropDown working with value=''

This commit is contained in:
anovazzi1 2023-04-03 17:54:49 -03:00
commit aa7a78231d

View file

@ -5,7 +5,7 @@ import { DropDownComponentType } from "../../types/components";
import { classNames } from "../../utils";
export default function Dropdown({value, options, onSelect}:DropDownComponentType) {
let [internalValue,setInternalValue] = useState(value??"Choose an option")
let [internalValue,setInternalValue] = useState(value===""||!value?"Choose an option":value)
return (
<>
<Listbox value={internalValue} onChange={(value)=>{