react-flip-move
react-flip-move copied to clipboard
TypeScript Error when adding children
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.
Also experiencing this. Seems as though it was "fixed" in 9f17f68, but hasn't been published so doesn't actually fix the issue yet.
I saw that and was wondering why it wasn't fixing the issues. That makes sense. Thanks @cozmo. @nickjs Do you know when you're change is going to get released?
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!
Still waiting for response https://github.com/joshwcomeau/react-flip-move/issues/233#issuecomment-1107257677 since I don’t have the npm permission to publish a release.
when will this be pushed live?
The new version (3.0.5) is published: https://www.npmjs.com/package/react-flip-move
Confirmed the type export correctly:
interface FlipMoveProps {
/**
* The children to animate. Each child must have a unique key to work correctly.
*/
children?: React.ReactNode;
Please feel free to reopen if there is any problem.