forma-36 icon indicating copy to clipboard operation
forma-36 copied to clipboard

🐛 Bug - TS error with selectedItem property

Open Thayakaran opened this issue 3 years ago • 2 comments

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 avatar May 27 '22 20:05 Thayakaran

@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?

Lelith avatar May 30 '22 07:05 Lelith

Marking issue as stale since there was no acitivty for 30 days

github-actions[bot] avatar Aug 06 '22 07:08 github-actions[bot]

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!

denkristoffer avatar Aug 31 '22 09:08 denkristoffer