React-select: Generic type 'ComponentType' requires 1 type argument(s)

Created on 21 Nov 2017  路  1Comment  路  Source: JedWatson/react-select

Getting the following error when using @types/react-select at run time:

ERROR in [at-loader] ./node_modules/@types/react-select/index.d.ts:361:23
TS2314: Generic type 'ComponentType' requires 1 type argument(s).
ERROR in [at-loader] ./node_modules/@types/react-select/index.d.ts:426:22
TS2314: Generic type 'ComponentType' requires 1 type argument(s).

I am able to correct the type script errors by changing the lines of index.d.ts

from:
optionComponent?: React.ComponentType;
to
optionComponent?: React.ComponentType<TValue>;

and
valueComponent?: React.ComponentType;
to
valueComponent?: React.ComponentType<TValue>;

>All comments

I'm not sure where you're getting these types from, but we're not shipping .d.ts files in react-select...

Going to close this because we can't do anything about it, but thanks for the report! corrections will hopefully be useful to others as well.

Was this page helpful?
0 / 5 - 0 ratings