SolvedDefinitelyTyped [recompose] Generic type 'ReactElement<P>' requires 1 type argument(s)

If you know how to fix the issue, make a pull request instead.

  • I tried using the @types/recompose package and had problems.
  • I tried using the latest stable version of tsc. https://www.npmjs.com/package/typescript
  • I have a question that is inappropriate for StackOverflow. (Please ask any appropriate questions there).
  • Mention the authors (see Definitions by: in index.d.ts) so they can respond.
    • Authors: @iskandersierra (and many others, will not mention them all to reduce spam)

With the latest published version of @types/recompose I get the following error while building:

../../node_modules/@types/recompose/index.d.ts:338:8 - error TS2314: Generic type 'ReactElement<P>' requires 1 type argument(s).

338     ): React.ReactElement;
14 Answers

✔️Accepted Answer

@ffflorian Hi !
You have to use the last version of @types/react

Other Answers:

@VincentLanglet I'm sorry it's not with recompose.
I find the reason why it's still wrong when I update @types/react. There is something wrong with my yarn.lock file

I manually removed "@types/react@*" entries from yarn.lock and did a new yarn install which solved the problem for me.

Project:
@types/react version 16.8.3
@types/react-dom version 16.8.2
typescript version 3.3.3

@types/react version 16.8.3
@types/react-dom version 16.8.2
typescript version 3.3.3
still has the problem

Thank you for this solution
You have to use the last version of @types/react

More Issues: