title: React-redux connect method unable to locate store in props
body: <p>I have a application structure that mostly mimics the redux <a href="https://github.com/rackt/redux/tree/master/examples/real-world" rel="noreferrer">real-world</a> example but can't get past getting this error:</p>
  
  <p><code>Uncaught Error: Invariant Violation: Could not find "store" in either the context or props of "Connect(Home)". Either wrap the root component in a &lt;Provider&gt;, or explicitly pass "store" as a prop to "Connect(Home)".</code></p>
  
  <p>Here follows my application structure:</p>
  
  <h1>render</h1>
  
  <pre><code>import { render, createFactory } from 'react'
  import { Provider } from 'react-redux';
  import router from './router/router'
  import store from './flux/store'
  
  window.onload = () =&gt; {
      render(createFactory(Provider)({store: store},
          () =&gt; router
      ), document.body)
  };
  </code></pre>
  
  <h1>Router</h1>
  
  <pre><code>import { _ } from 'factories'
  import { Router, IndexRoute, Route } from 'react-router'
  import history from 'history/lib/createBrowserHistory'
  
  import Home from '../components/home/home'
  
  let route = _(Route),
      index = _(IndexRoute);
  
  let router = _(Router)({history: history()},
      route({path: 'home', component: Home})
  );
  
  export default router;
  </code></pre>
  
  <h1>Home Component</h1>
  
  <pre><code>import React, { PropTypes } from 'react'
  import { div } from 'factories'
  import { connect } from 'react-redux'
  import { bindActionCreators } from 'redux';
  import * as users from '../../flux/actions/users'
  
  class Home extends React.Component {
  
      constructor() {
  
          super();
  
          this.state = {}
      }
  
      componentWillMount() {
          console.log(this.props.users.user)
      }
  
      componentWillUnmount() {
  
      }
  
      render() {
  
          return (
              div({}, "Home")
          )
      }
  }
  
  export default connect(
      state =&gt; {
          return {
              users: state.users
          }
      },
      dispatch =&gt; bindActionCreators(users, dispatch)
  )(Home)
  </code></pre>
  
  <p>This results in getting the above mentioned error. as you can see I am passing the store in the same manner as shown in the redux example.</p>