autocomplete
<Controller
control={control}
name="status"
render={({ field }) => (
<Autocomplete
{...field}
options={statusOptions}
getOptionLabel={(option) => option.label}
onChange={(, value) => {
field.onChange(value?.value ?? value);
}}
isOptionEqualToValue={(option, value) =>
value === undefined ||
option?.value?.toString() ===
(value?.value ?? value)?.toString()
}
renderInput={(params) => (
<TextField
{...params}
/>
)}
/>
)}
/>
im getting this problem:
Type '{ options: { value: string; label: string; }[]; getOptionLabel: (option: { value: string; label: string; }) => string; onChange: (: SyntheticEvent<Element, Event>, value: { ...; } | null) => void; ... 6 more ...; ref: RefCallBack; }' is not assignable to type 'AutocompleteProps<{ value: string; label: string; }, false, false, false, "div">'.
Types of property 'value' are incompatible.
Type '"ACTIVE" | "IN_ACTIVE"' is not assignable to type '{ value: string; label: string; } | null | undefined'.
Type 'string' is not assignable to type '{ value: string; label: string; }'.ts(2322)
control={control}
name="status"
render={({ field }) => (
<Autocomplete
{...field}
options={statusOptions}
getOptionLabel={(option) => option.label}
onChange={(, value) => {
field.onChange(value?.value ?? value);
}}
isOptionEqualToValue={(option, value) =>
value === undefined ||
option?.value?.toString() ===
(value?.value ?? value)?.toString()
}
renderInput={(params) => (
<TextField
{...params}
/>
)}
/>
)}
/>
im getting this problem:
Type '{ options: { value: string; label: string; }[]; getOptionLabel: (option: { value: string; label: string; }) => string; onChange: (: SyntheticEvent<Element, Event>, value: { ...; } | null) => void; ... 6 more ...; ref: RefCallBack; }' is not assignable to type 'AutocompleteProps<{ value: string; label: string; }, false, false, false, "div">'.
Types of property 'value' are incompatible.
Type '"ACTIVE" | "IN_ACTIVE"' is not assignable to type '{ value: string; label: string; } | null | undefined'.
Type 'string' is not assignable to type '{ value: string; label: string; }'.ts(2322)
