I just upgraded my project from react 17 to react 18 and now I'm getting this error.
TS2769: No overload matches this call.
Overload 1 of 2, '(props: DraggableProps | Readonly): Draggable', gave the following error.
Type '{ children: ReactNode; key: number; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly'.
Property 'children' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly'.
Overload 2 of 2, '(props: DraggableProps, context: any): Draggable', gave the following error.
Type '{ children: ReactNode; key: number; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly'.
Property 'children' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly'.
this is my code:
function ReorderList({ items }: props) {
const [allItems, setAllItems] = useState(items);
return (
<div className="reorder-list">
<Container
lockAxis="y"
dragClass="reorder-list-dragging"
dragHandleSelector=".reorder-list-handle"
onDrop={(event) => setAllItems(applyDrag(allItems, event))}
>
{allItems.map((item, idx) => {
return <Draggable key={idx}>{item}</Draggable>;
})}
</Container>
</div>
);
}
I just upgraded my project from react 17 to react 18 and now I'm getting this error.
this is my code: