react-flip-move
react-flip-move copied to clipboard
Using FlipMove with TypeScript functional components
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?
I solved add the "children?: React.ReactNode" on FlipMoveProps:

thank's @douglasg14b (https://github.com/joshwcomeau/react-flip-move/issues/269)
I didn't understand. Where and what should be added?
I didn't understand. Where and what should be added?
in any *.d.ts file