Нинада так. ``` import thunk, { ThunkAction } from 'redux-thunk'; import { Action, ActionCreator, combineReducers } from 'redux'; // Плюс импортируешь rootReducer // ... export type RootState = ReturnType<typeof rootReducer>; export type AppDispatch = typeof store.dispatch; export type AppThunk<TReturn = void> = ActionCreator< ThunkAction<TReturn, RootState, unknown, Action> >; ``` а потом все thunks типизируешь как const MyCoolAsyncThunk : AppThunk = (...) => { ... }.
Обсуждают сегодня