If you know how to fix the issue, make a pull request instead.
@types/recompose
package and had problems.Definitions by:
in index.d.ts
) so they can respond.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;
@ffflorian Hi !
You have to use the last version of @types/react
Thank you for this solution
You have to use the last version of @types/react
Thank you. Updating@types/react
worked for me, too.
@ffflorian Can we close this issue ?
@types/react
version 16.8.3
@types/react-dom
version 16.8.2
typescript
version 3.3.3
still has the problem
@AlvinYuXT With the recompose library ?
If you have @types/react: 16.8.3
, you should have
interface ReactElement<P = any, T extends string | JSXElementConstructor<any> = string | JSXElementConstructor<any>> {
type: T;
props: P;
key: Key | null;
}
Line 86
Upgrading @types/react
to 16.8.3 fixed it for me, too. Thanks!
@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 discovered that my @types/react
had been implicitly added as a sub-dependency of something else and was an older version. By making it explicit in package.json
solved this for me. Try:
npm i @types/react --save-dev
and see if that solves it for you. Hope this helps someone.
@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 myyarn.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
Use this next time ;)
https://github.com/atlassian/yarn-deduplicate
To fix hoisting, instead of yarn deduplicate, you could also put a temporary resolution entry in your package with the version you want to fix the lock file. In other words:
yarn why @types/react
...to list all versions and see if you have a problem with this package and why
edit your package.json to put a resolution line, something like:
"resolutions": {
"@types/react": "16.8.3"
}
then run yarn install
(then check it out with yarn why again to see that it is all hoisted into one)
Check if all goes well with your build then remove the resolution entry (since the lock file contains what you wanted now).
Using version 16.8.3 fixed it for me.
Most helpful comment
@ffflorian Hi !
You have to use the last version of
@types/react