React-select: TypeScript error: node_modules/@types/react-select/lib/components/indicators.d.ts(19,13): Error TS2314: Generic type 'ReactElement<P>' requires 1 type argument(s).

Created on 13 May 2019  路  4Comments  路  Source: JedWatson/react-select

Reporting a bug

react 16.8.4
react-dom 16.8.4
react-select 2.4.3
@types/react-select 2.0.17
typescript 3.2.2

I get this error once I add the @types/react-select package to my project and then building (no error without the types package)

TypeScript error: node_modules/@types/react-select/lib/components/indicators.d.ts(19,13): Error TS2314: Generic type 'ReactElement<P>' requires 1 type argument(s).

Thanks!

awaiting-author-response issureviewed

Most helpful comment

Looks like moving back to 2.0.8 of the @types/react-select package solves this issue.

Note: You will then run into the problem outlined at https://stackoverflow.com/questions/54698733/types-react-transition-group-generic-type-reactelementp-t-requires-betwee/56135556#56135556. Follow my answer there for how to resolve that as well and finally build.

All 4 comments

This is certainly weird because https://github.com/DefinitelyTyped/DefinitelyTyped/blob/7c33a958277e53aa335dcddec28ebfe6502638ca/types/react-select/lib/components/indicators.d.ts line 19 says:

children: ElementType<any>,

So perhaps the npm package @types/react-select is out of date? (I am using 2.0.17)

Looks like moving back to 2.0.8 of the @types/react-select package solves this issue.

Note: You will then run into the problem outlined at https://stackoverflow.com/questions/54698733/types-react-transition-group-generic-type-reactelementp-t-requires-betwee/56135556#56135556. Follow my answer there for how to resolve that as well and finally build.

Hi @sathiathirumal, wanted to check in and see if you resolved this properly.

This issue will now be closed due to inactivity. If anyone can provide further feedback, the issue will be re-opened.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mbonaci picture mbonaci  路  3Comments

ericj17 picture ericj17  路  3Comments

Meesam picture Meesam  路  3Comments

batusai513 picture batusai513  路  3Comments

mjuopperi picture mjuopperi  路  3Comments