diff --git a/src/combineReducers.ts b/src/combineReducers.ts index bf4520f6d2..7bd5a8fd8e 100644 --- a/src/combineReducers.ts +++ b/src/combineReducers.ts @@ -176,8 +176,10 @@ export default function combineReducers( const key = finalReducerKeys[i] const reducer = finalReducers[key] const previousStateForKey = state[key] - // @ts-ignore - const nextStateForKey = reducer(previousStateForKey, action) + const nextStateForKey = reducer( + previousStateForKey as undefined, + action as never + ) if (typeof nextStateForKey === 'undefined') { const actionType = action && action.type throw new Error( @@ -188,8 +190,8 @@ export default function combineReducers( `If you want this reducer to hold no value, you can return null instead of undefined.` ) } - // @ts-ignore - nextState[key as keyof typeof nextState] = nextStateForKey + nextState[key as keyof typeof nextState] = + nextStateForKey as (typeof nextState)[keyof typeof nextState] hasChanged = hasChanged || nextStateForKey !== previousStateForKey } hasChanged =