APSL / redux-i18n

A simple and powerful package for translate your react applications using react-redux.
MIT License
233 stars 52 forks source link

Generic type 'ThunkAction' requires 4 type argument(s). #88

Open jguipi opened 6 years ago

jguipi commented 6 years ago

I'm using typescript and when I added your library to my projet I got this error and it wont compile. Even if I modify the code to add an argument It wont compile. Here's the error :

C:/Users/xxxxx/dev/react_project/node_modules/redux-i18n/index.d.ts (53,116): Generic type 'ThunkAction' requires 4 type argument(s).

Here's my dependencies :

"dependencies": {
"react": "^16.4.2",
"react-dom": "^16.4.2",
"react-redux": "^5.0.7",
"react-router-dom": "^4.3.1",
"react-scripts-ts": "2.17.0",
"redux": "^4.0.0",
"redux-devtools-extension": "^2.13.5",
"redux-i18n": "^1.5.13",
"redux-saga": "^0.16.0",
"redux-thunk": "^2.3.0",
"save-dev": "^2.0.0"
}
veldman commented 6 years ago

Workaround is to install redux-thunk@2.1 which will install version 2.1.2 of redux-thunk:

npm install --save redux-thunk@2.1

jguipi commented 6 years ago

with version 2.1.2 im still getting :Generic type 'Dispatch<A, S>' requires 2 type argument(s).

veldman commented 6 years ago

This is probably unrelated to that change though. Do you have a full trace ? @jguipi

jguipi commented 6 years ago

For some reason i modify the code to add an extra argument again and it worked. I dont know why it worked this time but i'm good now. To make it work I edited : C:\Users\userxxxxx\dev\project-namet\node_modules\redux-i18n\index.d.ts

I made the line 53 look like this: export function setTranslations(translations: ITranslations, languageOrOptions?: IlanguageOrOptions | string): ThunkAction<any, any, any, any>