const [openDropdown, setOpenDropdown] = useState(false);
<Controller
control={control}
name={EPaymentFormField.PROMOTION_COUPON_ID}
render={({ field: { value, onChange } }) => {
const handleChange = (callback: any) => {
onChange(callback());
};
return (
<DropdownPicker
placeholder={t('paymentDetail_coupon_label', {
numOfAvailableCoupons: numOfAvailableCoupons,
numOfTotalCoupons: numOfTotalCoupons,
})}
open={openDropdown}
setOpen={setOpenDropdown}
value={value}
setValue={handleChange}
items={dropdownData}
multiple={false}
/>
);
}}
/>
How can I use without open, setOpen properties on DropDownPicker? these are essential properties in this library. But I don't want to use useState.
So, If it can, I want to use it without open, setOpen properties or useState.
Is anyone knows solution?