Redux’s Mysterious Connect Function
tyler clark

Hmmm, I am using mapStateToProps and bindActionCreators:

const mapStateToProps = (state, ownProps) => {return {
somePropsKey: state.SomePartOfMyStore
const mapDispatchToProps = (dispatch, ownProps) => {
return bindActionCreators({
}, dispatch)

In mapStateToProps, the key(s) defined will be accessible as props to the connected component, i.e. this.props.somePropsKey

The function bindActionCreators does the sam thing for your imported action creators, i.e. this.props.someActionCreator

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.