был из combineReducers?
const rootReducer = (history: History) =>
combineReducers({
router: connectRouter(history),
user: userReducer,
company: companiesSlice,
});
export type RootState = ReturnType<typeof rootReducer>;
в typesafe-actions делают так: export declare type StateType<TReducerOrMap extends any> = TReducerOrMap extends Reducer<any, any> ? ReturnType<TReducerOrMap> : TReducerOrMap extends Record<any, any> ? { [K in keyof TReducerOrMap]: StateType<TReducerOrMap[K]>; } : never; export type RootState = StateType<typeof combinedReducer>;
Обсуждают сегодня