redux Map state to properties


Example

After you wrapped your app into provider you can use connect function to subscribe your component to store changes and provide mapping between Redux state properties and React components' properties:

import { connect } from 'react-redux';

const MyComponent = ({data})  => (
  <div>{data}</div>
);

const mapStateToProps = (state, ownProps) => ({
  data: state.myComponentData
});

connect(mapStateToProps)(MyComponent);