-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Closed
Description
I get a Could not find "store" in either the context or props
error whenever I try to connect
a component to Redux.
When I'm in the debug console I can see that state
is defined on this
and context
but it has a value of undefined
. Also, when I inspect createStore
I get an object back with dispatch
, getState
, etc.
import { Provider } from 'react-redux';
import React from 'react';
import reducers from '../config/reducers';
import { createStore } from 'redux';
import routes from '../config/routes';
React.render(
<Provider store={ createStore(reducers) }>
{ () => routes }
</Provider>
, document.body);
Component
import React from 'react';
// components
import Footer from './_footer';
import Header from './_header';
// redux
import { connect } from 'react-redux';
import ClientSessionActionCreators from '../../actions/client-session-action-creators';
class ApplicationLayout extends React.Component {
render() {
return (
<div>
<Header />
{ this.props.children }
<Footer />
</div>
);
}
}
export default connect(state => state)(ApplicationLayout);
y2k-shubham, razvantomegea, alexander-elgin, piperchester, Amin52J and 4 more
Metadata
Metadata
Assignees
Labels
No labels