Skip to content
This repository has been archived by the owner on Feb 20, 2019. It is now read-only.

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

Open
cristian-sima opened this issue Feb 16, 2019 · 2 comments

Comments

@cristian-sima
Copy link

cristian-sima commented Feb 16, 2019

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
Copy link
Author

image

@cristian-sima
Copy link
Author

@tonyhb There is an urgent need to do this

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant