Property 'children' does not exist on type 'IntrinsicAttributes....'
See original GitHub issueI 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<DraggableProps>): Draggable’, gave the following error. Type ‘{ children: ReactNode; key: number; }’ is not assignable to type ‘IntrinsicAttributes & IntrinsicClassAttributes<Draggable> & Readonly<DraggableProps>’. Property ‘children’ does not exist on type ‘IntrinsicAttributes & IntrinsicClassAttributes<Draggable> & Readonly<DraggableProps>’. 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<Draggable> & Readonly<DraggableProps>’. Property ‘children’ does not exist on type ‘IntrinsicAttributes & IntrinsicClassAttributes<Draggable> & Readonly<DraggableProps>’.
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>
);
}
Issue Analytics
- State:
- Created a year ago
- Comments:10
Top GitHub Comments
@SerhiyDemchuk I thought when the error is gone everything should work. I have lots of errors in the console and just a blank screen. someone should update the documentation.
While suggested patch did work, a patched version will be lifesaver for many of us.