Skip to content

Instantly share code, notes, and snippets.

@radiegtya
Created May 13, 2018 03:43
Show Gist options
  • Save radiegtya/7d914b8ff254ed92dfb1308e52024af8 to your computer and use it in GitHub Desktop.
Save radiegtya/7d914b8ff254ed92dfb1308e52024af8 to your computer and use it in GitHub Desktop.
class Profiles extends Component {
// ... THE REST OF CLASS CODE
}
// #1. make const named mapStateToProps to mapping our state, to object called profiles
// the state is called profilesReducer because we got it from the profile reducers that we made earlier
const mapStateToProps = (state)=>({
profiles: state.profilesReducer
})
// #2. connecting redux with Component, we use "connect" from "react-redux" library to do this, don't confuse with the syntax
export default connect(mapStateToProps)(Profiles)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment