Open Venryx opened 6 years ago
I'm experiencing the same issue. I just installed 5.10.0, and getting the same error but i'm using "redux": "3.7.2" not the "4.0.0". When I downgrade to 5.9.1, it seems to address the issue. Perhaps the 5.10 is tied to a specific redux version?
For now, I'm brute-forcing a fix by just manually changing that line in the node_modules/.../index.d.ts file to:
export function persistReducer<S, A extends Action>(config: PersistConfig, baseReducer: Reducer<S>): Reducer<S & PersistPartial>;
Not a real solution since manual node_modules changes can't be cleanly tracked by git, but a stop-gap fix for the moment.
I believe @darewreck54 is correct. The type definitions for 5.10.0
assume Redux ^4.0.0
, in which the type signature for reducers changed, but that is not reflected anywhere in package.json
.
@rt2zz, Not sure if the correct course of action is to change the peer dependency version or to bump a major version here, but I think some check does need to be put in place.
@Venryx, you can also change the redux-persist
version in your project's package.json
to 5.9.1
instead of ^5.X.X
to enforce the correct version until this is resolved.
was this ever fixed ?
Any updates?
Any updates?
any update on this
2020 here
Typescript error message:
This is caused because between version 5.9.1 and 5.10.0, the index.d.ts contents for the persistReducer file in redux-persist changed from:
To:
I don't know which is "correct", but I know that the new version is causing typescript errors (since Typescript says
Reducer
only accepts one type argument), and that a semver minor update shouldn't be introducing new errors.Note that I'm using the same redux version in both projects, v3.7.2. (error showed in new project with redux-persist 5.10.0, but not in the one with 5.9.1, so I investigated the cause)