create-react-app-typescript icon indicating copy to clipboard operation
create-react-app-typescript copied to clipboard

Failed to compile: Errors in @types

Open akyker20 opened this issue 7 years ago • 1 comments

I installed the react-redux and redux-thunk packages to my project.

When I run npm start, I get errors in both of these packages' types files. For instance:

/Users/austinkyker/reading_rewards/frontend/node_modules/@types/react-redux/index.d.ts (37,59): Generic type 'Dispatch<A, S>' requires 2 type argument(s).

This prevents me from compiling my project. I think this might be because I am using redux 4 and the types for these projects have not been updated for redux 4.

Any ideas on what I should do?

Worst case I'd like to just ignore these errors. How can I do that and still compile?

akyker20 avatar May 28 '18 16:05 akyker20

A sample project for reproducing this would be useful ... this is not mentioned for no reason in the issue template. The error simply indicates that Dispatch is used without the type parameters it requires - dunno which one, since you've cut of the path that would mention this. The current redux are declaring Dispatch with a single type parameter, which also has a default value and thus can be omitted. Same hold true for react-redux. redux-thunk does not even declare a type of this name.

DorianGrey avatar May 29 '18 06:05 DorianGrey