React-select: Generic type 'Component<P, S>' requires 2 type argument

Created on 14 Jul 2017  路  6Comments  路  Source: JedWatson/react-select

The new update on typescript (2.4.1) has some compatibility issue with the react-select types.

"node_modules/@types/react-select/index.d.ts(472,40): error TS2314: Generic type 'Component' requires 2 type argument(s)."

Most helpful comment

@junibrosas You should try updating your version of @types/react to latest. It should resolve that issue. I just installed @types/react version 16.0.2 and I'm all set. I'm also using Typescript version 2.4.2. In version 2.3 Generic parameter defaults were released which is related to this typings change. It's a nice feature if you're doing a lot with generics.

I hope this info helped.

All 6 comments

Hi @junibrosas we don't use Typescript anywhere in the codebase, so not sure where it gets these types from. Maybe from some other repo?

@junibrosas You should try updating your version of @types/react to latest. It should resolve that issue. I just installed @types/react version 16.0.2 and I'm all set. I'm also using Typescript version 2.4.2. In version 2.3 Generic parameter defaults were released which is related to this typings change. It's a nice feature if you're doing a lot with generics.

I hope this info helped.

@JoeRall You are correct. I installed the latest @types/react, @types/react-select, and typescript.

npm install @types/[email protected] @types/react-select [email protected] --save-dev

@junibrosas Glad to hear!

@agirton I guess this issue is safe to close.

Thanks!

Was this page helpful?
0 / 5 - 0 ratings