Хочу настроить getDefaultMiddleware, но когда добавляю это в поле middleware, пишет, что неправильный тип. Что там за тип такой нужен?
const store = configureStore<StateSchema>({
reducer: reducerManager.reduce,
devTools: __IS_DEV__,
preloadedState: initialState,
middleware: (getDefaultMiddleware) => getDefaultMiddleware()
})
middleware подчеркивается и пишет такую ошибку:
'[ThunkMiddleware<StateSchema, AnyAction>]'.ts(2322)
configureStore.d.ts(30, 5): The expected type comes from property 'middleware' which is declared here on type 'ConfigureStoreOptions<StateSchema, AnyAction, [ThunkMiddleware<StateSchema, AnyAction>], [StoreEnhancer]>'
(property) ConfigureStoreOptions<StateSchema, AnyAction, [ThunkMiddleware<S, AnyAction>], [StoreEnhancer]>.middleware?: [ThunkMiddleware<S, AnyAction>] | ((getDefaultMiddleware: CurriedGetDefaultMiddleware<StateSchema>) => [...])
An array of Redux middleware to install. If not supplied, defaults to the set of middleware returned by getDefaultMiddleware().
@example
`middleware: (gDM) => gDM().concat(logger, apiMiddleware, yourCustomMiddleware)`
@see — https://redux-toolkit.js.org/api/getDefaultMiddleware#intended-usage