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

Using FlipMove with TypeScript functional components #271

Open
borgdrone7 opened this issue Jun 8, 2022 · 3 comments
Open

Using FlipMove with TypeScript functional components #271

borgdrone7 opened this issue Jun 8, 2022 · 3 comments

Comments

@borgdrone7
Copy link

borgdrone7 commented Jun 8, 2022

Hi,
I am rendering form elements which are functional components and trying to use FlipMove with them like this:

        <FlipMove>
          {components_length ? getComponents(components, dispatch):null}
        </FlipMove>

However I am getting this error:

TS2769: No overload matches this call.   Overload 1 of 2, '(props: FlipMoveProps | Readonly<FlipMoveProps>): FlipMove', gave the following error.     Type '{ children: FormComponent[] | null; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<FlipMove> & Readonly<FlipMoveProps>'.   Overload 2 of 2, '(props: FlipMoveProps, context: any): FlipMove', gave the following error.     Type '{ children: FormComponent[] | null; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<FlipMove> & Readonly<FlipMoveProps>'

Components are dynamic and very complex and I couldn't make example for functional components in read me work in my case.
Anyone knows how to solve this issue?

@matheusinfo
Copy link

matheusinfo commented Jun 21, 2022

I solved add the "children?: React.ReactNode" on FlipMoveProps:

image

thank's @douglasg14b (#269)

@Disolm
Copy link

Disolm commented Dec 1, 2022

I didn't understand. Where and what should be added?

@thNel
Copy link

thNel commented Apr 6, 2023

I didn't understand. Where and what should be added?

in any *.d.ts file

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

4 participants