Redux createStore error: Expected the reducer to be a function

Redux createStore error: Expected the reducer to be a function

我在 createStore 上遇到错误,我不明白为什么。

import { createStore, applyMiddleware, combineReducers, compose } from 'redux';
import thunk from "redux-thunk"
import promise from "redux-promise-middleware"
import * as reducers from './reducers';

const middleware = applyMiddleware(promise(), thunk);

export default createStore(reducers, middleware);

以上是我的代码,我在行中得到了错误

const middleware = applyMiddleware(promise(), thunk);

错误是预期 Reducer 是一个函数。 我正在使用 React Native 0.37 和最新版本的 redux、redux-thunk 和 redux-promise-middleware。 reducers 是 combineReducers 的结果。

提前致谢。

import * as reducers from './reducers';

reducers 不可能是函数。您将获得一个对象,每次导出为 属性。你可能想要:

import reducers from './reducers';