You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using typescript, redux, and curried producer from immer altogether, the return type of the curried reducer is not understood by combineReducers which leads to "unknown" type combined reducer and impossibility to access the states
To Reproduce
Create a curried producer as a reducer.
Use combineReducers on this producer
Type of said combineReducer is "unknown"
Expected behavior
A clear and concise description of what you expected to happen.
Just tested this against the upcoming Immer 5.3, with TypeScript 3.7.3 and the latest Redux 4.0.5, and the issue doesn't appear there anymore. Added unit test to prevent regressions in the future.
馃悰 Bug Report
When using typescript, redux, and curried producer from immer altogether, the return type of the curried reducer is not understood by combineReducers which leads to "unknown" type combined reducer and impossibility to access the states
To Reproduce
Create a curried producer as a reducer.
Use combineReducers on this producer
Type of said combineReducer is "unknown"
Expected behavior
A clear and concise description of what you expected to happen.
Link to repro (highly encouraged)
https://codesandbox.io/s/typescript-react-redux-f4pvk
In rdx.ts, the type of "reduce" is :
const reduce: redux.Reducer<{ counterReducer: State; }, redux.AnyAction>
And the type of curriedReduce is :
const curredReduce: redux.Reducer<unknown, redux.AnyAction>
Therefore after creating the store, we are unable to access its "sub-states"
Environment
The text was updated successfully, but these errors were encountered: