react-draggable
react-draggable copied to clipboard
in typescript the type notice error: is not assignable to type 'IntrinsicAttributes
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>