question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeScript Error when adding children

See original GitHub issue

Here’s all that’s going on in my .tsx:

const stuff = [1, 2, 3]

  return (
    <FlipMove>
      {stuff.map((item) => {
        return (
         <div key={item}>some div</div>
        );
      })}
    </FlipMove>
  );

I get the following TS error:

[{
	"resource": "xxx.tsx",
	"owner": "typescript",
	"code": "2769",
	"severity": 8,
	"message": "No overload matches this call.\n  Overload 1 of 2, '(props: FlipMoveProps | Readonly<FlipMoveProps>): FlipMove', gave the following error.\n    Type '{ children: Element[]; duration: number; staggerDurationBy: number; staggerDelayBy: number; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<FlipMove> & Readonly<FlipMoveProps>'.\n      Property 'children' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<FlipMove> & Readonly<FlipMoveProps>'.\n  Overload 2 of 2, '(props: FlipMoveProps, context: any): FlipMove', gave the following error.\n    Type '{ children: Element[]; duration: number; staggerDurationBy: number; staggerDelayBy: number; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<FlipMove> & Readonly<FlipMoveProps>'.\n      Property 'children' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<FlipMove> & Readonly<FlipMoveProps>'.",
	"source": "ts",
	"startLineNumber": 41,
	"startColumn": 6,
	"endLineNumber": 41,
	"endColumn": 14
}]

I’m using react-flip-move 3.0.4, which is the latest.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
samstrcommented, Aug 31, 2022

when will this be pushed live?

3reactions
nickjscommented, Jul 20, 2022

No idea, I know it got merged, but I’m not sure when the maintainers would want to cut a release. I defer to you, @xcv58!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Typescript error when adding children to Card #3556 - GitHub
I am trying to add children to Card component, but getting a Typescript error. Type '{ children: Element; }' has no properties in...
Read more >
React 18 TypeScript children FC - Stack Overflow
This error occurs when you are passing no props to the Component. children prop should be an optional prop. So giving those props...
Read more >
property 'children' does not exist on type 'intrinsicattributes
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 >
дэн on Twitter: "If you're getting TypeScript errors about the ...
If you're getting TypeScript errors about the `children` prop when upgrading @types/react to 18.0.0, the fix looks like this.
Read more >
How Children Types Work In React 18 And TypeScript 4
Which one should we use for adding types to children in our custom components? When to use ReactNode, ReactElement, or JSX.Element. A common ......
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