react-draggable icon indicating copy to clipboard operation
react-draggable copied to clipboard

in typescript the type notice error: is not assignable to type 'IntrinsicAttributes

Open seanock opened this issue 3 years ago • 2 comments
trafficstars

TS2322: Type '{ children: Element[]; list: TagItem[]; setList: Dispatch<SetStateAction<TagItem[]>>; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<ReactSortable<TagItem>> & Pick<Readonly<ReactSortableProps<TagItem>>, never> & InexactPartial<...> & InexactPartial<...>'.   Property 'children' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<ReactSortable<TagItem>> & Pick<Readonly<ReactSortableProps<TagItem>>, never> & InexactPartial<...> & InexactPartial<...>'.

my code:

type TagItem = { id: number, name: string, parent_id: number }

  const [tags, setTags] = useState<TagItem[]>([])

  <ReactSortable list={tags} setList={setTags}>
   {
                tags.map(tag => <TagItem key={tag.id} tag={tag} />)
   }
 </ReactSortable>

seanock avatar May 26 '22 10:05 seanock