Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript Error when adding children #273

Closed
lancesnider opened this issue Jul 10, 2022 · 7 comments
Closed

TypeScript Error when adding children #273

lancesnider opened this issue Jul 10, 2022 · 7 comments

Comments

@lancesnider
Copy link

lancesnider commented Jul 10, 2022

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.

@cozmo
Copy link

cozmo commented Jul 19, 2022

Also experiencing this. Seems as though it was "fixed" in 9f17f68, but hasn't been published so doesn't actually fix the issue yet.

@lancesnider
Copy link
Author

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?

@nickjs
Copy link
Contributor

nickjs commented 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!

@xcv58
Copy link
Collaborator

xcv58 commented Jul 20, 2022

Still waiting for response #233 (comment) since I don’t have the npm permission to publish a release.

@samstr
Copy link

samstr commented Aug 31, 2022

when will this be pushed live?

@xcv58
Copy link
Collaborator

xcv58 commented Dec 2, 2022

The new version (3.0.5) is published: https://www.npmjs.com/package/react-flip-move

@xcv58
Copy link
Collaborator

xcv58 commented Dec 2, 2022

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.

@xcv58 xcv58 closed this as completed Dec 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants