在上下文或道具中找不到 "store"

Could not find "store" in either the context or props

我有这个错误:

Uncaught Invariant Violation: Could not find "store" in either the context or props of "Connect(ItemIndex)". Either wrap the root component in a <Provider>, or explicitly pass "store" as a prop to "Connect(ItemIndex)".

我的代码是:

const createStoreWithMiddleware = applyMiddleware(
  promise
)(createStore);

ReactDOM.render(<ItemIndex />, document.querySelector('.container'));

如何解决这个错误?

我忘了添加提供者

import { Provider } from 'react-redux';

ReactDOM.render(
  <Provider store={createStoreWithMiddleware(reducers)}>
    <ItemIndex />
  </Provider>
  , document.querySelector('.container'));