Property 'children' does not exist on type 'IntrinsicAttributes....'

See original GitHub issue

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<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:open
  • Created a year ago
  • Comments:10

github_iconTop GitHub Comments

5reactions
pmoienicommented, May 11, 2022

@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.

image

3reactions
MSSPL-KamalenduGaraicommented, Aug 3, 2022

While suggested patch did work, a patched version will be lifesaver for many of us.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ts(2322) Property children does not exist on type 'Intrinsic ...
I'm getting the following error while trying to create a multimap with 'date' as the key and then iterate through the multimap which...
Read more >
React.js: Property 'children' does not exist on type 'X'
The React.js error "Property 'children' does not exist on type" occurs when we try access the children property in a component for which...
Read more >
Typescript error: Property 'children' does not exist on type ...
I'm getting this error on a typescript project I'm currently working on but also occurs when initing a new typescript project.
Read more >
property 'children' does not exist on type 'intrinsicattributes
React: How to solve: Property 'children' does not exist on type 'IntrinsicAttributes & Props'. Asked Oct 20, 2021 • 0 votes 2 answers....
Read more >
React 18 - Property 'children' does not exist fix [2022] - YouTube
If you have recently upgraded to React 18 and tried to follow tutorials from myself or others, you may run into the error:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found