You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I use the component I should not get a Typescript error when I specify the onAddition and onDelete property:
Current behaviour
TypesScript complains the there is no onAddition and onDelete prop TS2769: No overload matches this call. Overload 1 of 2, '(props: ReactTagsProps | Readonly<ReactTagsProps>): ReactTags', gave the following error. Type '{ className: string; tags: Tag[]; suggestions: { id: number; name: string; }[]; onAddition: (newTag: any) => void; onDelete: (tagIndex: any) => void; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<ReactTags> & Readonly<ReactTagsProps> & Readonly<...>'. Property 'onAddition' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<ReactTags> & Readonly<ReactTagsProps> & Readonly<...>'. Overload 2 of 2, '(props: ReactTagsProps, context: any): ReactTags', gave the following error. Type '{ className: string; tags: Tag[]; suggestions: { id: number; name: string; }[]; onAddition: (newTag: any) => void; onDelete: (tagIndex: any) => void; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<ReactTags> & Readonly<ReactTagsProps> & Readonly<...>'. Property 'onAddition' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<ReactTags> & Readonly<ReactTagsProps> & Readonly<...>'.
I'd recommend checking which type definition file the types you're seeing are being resolved from (e.g. cmd + click on the prop in VSCode) and checking if this matches the latest published version
You were right: For some reason I had the types for version 5.12 already installed. This was fixed by running npm install --save @types/react-tag-autocomplete to install the latest.
Expected behaviour
When I use the component I should not get a Typescript error when I specify the onAddition and onDelete property:
Current behaviour
TypesScript complains the there is no onAddition and onDelete prop
TS2769: No overload matches this call. Overload 1 of 2, '(props: ReactTagsProps | Readonly<ReactTagsProps>): ReactTags', gave the following error. Type '{ className: string; tags: Tag[]; suggestions: { id: number; name: string; }[]; onAddition: (newTag: any) => void; onDelete: (tagIndex: any) => void; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<ReactTags> & Readonly<ReactTagsProps> & Readonly<...>'. Property 'onAddition' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<ReactTags> & Readonly<ReactTagsProps> & Readonly<...>'. Overload 2 of 2, '(props: ReactTagsProps, context: any): ReactTags', gave the following error. Type '{ className: string; tags: Tag[]; suggestions: { id: number; name: string; }[]; onAddition: (newTag: any) => void; onDelete: (tagIndex: any) => void; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<ReactTags> & Readonly<ReactTagsProps> & Readonly<...>'. Property 'onAddition' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<ReactTags> & Readonly<ReactTagsProps> & Readonly<...>'.
Steps to Reproduce
Steps to reproduce the problem:
Example and screenshots
Please add a link to a minimal reproducible example of the bug if you have created one.
Screenshots
Your environment
The text was updated successfully, but these errors were encountered: