🐛 Bug - TS error with selectedItem property
selectedItem prop not working in Autocomplete component
when developing format36 Autocomplete with Typescript, unable to use selectedItem prop to make it controlled.
Type '{ items: { name: string; type: string; }[]; onInputValueChange: (value: any) => void; onSelectItem: any; itemToString: (item: { name: string; type: string; }) => string; renderItem: (item: { name: string; type: string; }) => string; selectedItem: any; }' is not assignable to type 'IntrinsicAttributes & AutocompleteProps<{ name: string; type: string; }> & { ref?: Ref<HTMLDivElement> | undefined; }'. Property 'selectedItem' does not exist on type 'IntrinsicAttributes & AutocompleteProps<{ name: string; type: string; }> & { ref?: Ref<HTMLDivElement> | undefined; }'. Did you mean 'onSelectItem'?ts(2322)
@Thayakaran Thank you for submitting this bug. Can you provide your implementation and types of how you apply the selectedItem property and how it gets initialised as well as updated?
Marking issue as stale since there was no acitivty for 30 days
Hey @Thayakaran, thanks for reporting this problem. I'm going to close this issue due to a lack of activity, but feel free to reopen with a reproducible example, so we can investigate further. Thanks again!