joshwcomeau / joshwcomeau/react-flip-move

Using FlipMove with TypeScript functional components

Open
#271 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
4.1k
Forks
250
PR merge metrics
No merged PRs in 30d

Description

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

```

{components_length ? getComponents(components, dispatch):null}

```
However I am getting this error:
```
TS2769: No overload matches this call.   Overload 1 of 2, '(props: FlipMoveProps | Readonly): FlipMove', gave the following error.     Type '{ children: FormComponent[] | null; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly'.   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 & Readonly'

```
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?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with FlipMove's TypeScript prop definitions and the README's functional-component example, then reproduce the reported children type error with a minimal functional-component case. Done means identifying whether the documented usage type-checks and updating the relevant typing or documentation so the supported usage is clear.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.