Unable to handle error: `middleware is not a function' in redux-promise-middleware?

Unable to handle error: `middleware is not a function' in redux-promise-middleware?

我正在尝试在我的应用程序中使用 redux-promise-middleware,但是当我尝试 运行 我的应用程序错误时会出现一条错误消息:'middleware is not a function or middleware is null'.

我尝试按照 redux async 文档中的建议使用没有功能的中间件,但仍然会出现错误。

configureStore.js


import { createStore, applyMiddleware } from 'redux'
import app from './reducers/index';
import PromiseMiddleware from 'redux-promise-middleware';

const configureStore = () => {
    let middleware = applyMiddleware(PromiseMiddleware());
    let store = createStore(app, middleware);
    return store
};

export default configureStore;

index.js


import React from 'react'
import { AppRegistry } from 'react-native';
import App from './App';
import { Provider } from 'react-redux'
import configureStore from './configureStore'

const store = configureStore();

const ReduxMiddleware = () => {
    <Provider store={store}>
        <App />
    </Provider>
}

AppRegistry.registerComponent('ReduxMiddleware', () => ReduxMiddleware);

请任何人告诉我为什么我会遇到这个错误。 我是 redux 的新手。

import promiseMiddleware from 'redux-promise-middleware';

composeStoreWithMiddleware = applyMiddleware(
   promiseMiddleware,
)(createStore);

而不是:PromiseMiddleware()

(不是大写和w/o () )