Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rafaellucio/b601dbcc7fc2f138fb2016d1d592d9fc to your computer and use it in GitHub Desktop.
Save rafaellucio/b601dbcc7fc2f138fb2016d1d592d9fc to your computer and use it in GitHub Desktop.
import { connect } from 'react-redux'
import Counter from './Counter'
const mapStateToProps = state => ({ count: state.count })
const mapDispatchToProps = dispatch => ({
increment: () => dispatch({ type: 'INCREMENT' }),
decrement: () => dispatch({ type: 'DECREMENT' })
})
export default connect(mapStateToProps, mapDispatchToProps)(Counter)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment