tonyhb / redux-ui

Easy UI state management for react redux
636 stars 58 forks source link

react-redux v6 - Uncaught Invariant Violation: Could not find "store" in either the context #89

Open cristian-sima opened 5 years ago

cristian-sima commented 5 years ago

The following code is not working with react-redux@6.0.0:

import { Provider } from "react-redux";
import React from "react";
import { ConnectedRouter } from "connected-react-router/immutable";

import { Route } from "react-router-dom";

import ui from "redux-ui";

const Account = ({ ui : { someChildProp } }) => (
  <div>
    {someChildProp}
  </div>
);

const AccountHome = ui({
  state: {
    someChildProp: "foo",
  },
})(Account);

const Root = ({ history, store }) => (
  <Provider store={store}>
    <ConnectedRouter history={history}>
      <Route component={AccountHome} exact path="/" />
    </ConnectedRouter>
  </Provider>
);

export default Root;

I am getting this:

image

cristian-sima commented 5 years ago

image

cristian-sima commented 5 years ago

@tonyhb There is an urgent need to do this