Currently in the process of refactoring a large redux state, I am facing an issue with reducers that have not yet been converted to typescript which are returning unknown
instead of any
. Is there a way to modify the default behavior of ReturnType
?
import { combineReducers } from 'redux';
import { connectRouter } from 'connected-react-router';
import pageReducer from './page';
const rootReducer = history =>
combineReducers({
router: connectRouter(history),
page: pageReducer,
....
....
});
export type AppState = ReturnType<ReturnType<typeof rootReducer>>
typings for combineReducers:
export function combineReducers<S>(
reducers: ReducersMapObject<S, any>
): Reducer<S>
export function combineReducers<S, A extends Action = AnyAction>(
reducers: ReducersMapObject<S, A>
): Reducer<S, A>