无法找到react-redux提供商

时间:2017-09-17 11:40:56

标签: reactjs react-redux

我完全重新安装了我的所有应用程序,现在我遇到了构建反应应用程序的问题。 enter image description here

问题文件包含以下视图:

import React from "react";
import ReactDOM from "react-dom";
import {Provider} from "react-redux";
import {createStore, combineReducers, applyMiddleware} from "redux";
import createLogger from "redux-logger";
import App from "./components/App.jsx";
import * as reducers from "./reducers";
import types from "./constants/actions";
import message from "./constants/message";
import mid from "./middleWare/mid";

const logger = createLogger();
const reducer = combineReducers(reducers);

const store = createStore(
    reducer,
    {
        userName: 'N/A',
        error: '',
        info: '',
        services: [],
        carwashes: [],
        backUrl : ''
    },
    applyMiddleware(mid, logger)
);

const destination = document.querySelector("#container");

ReactDOM.render(
    <Provider store={store}>
        <App/>
    </Provider>,
    destination
);

你知道错过了什么吗?

安装了React,redux和react-redux

enter image description here

1 个答案:

答案 0 :(得分:0)

这看起来更像是es6的一个问题。您可能会遗漏一些您可能已在全球安装的babel软件包。完全删除node_modules文件夹,然后执行yarn安装。

这不是抱怨提供商,它抱怨&lt;箭头