import React, { Component } from 'react'
import { connect } from 'react-redux'
import Header from '../shared/components/header'
class Home extends Component {
render () {
const { counter, increment, incrementBy, incrementAsync } = this.props
return (
Counter
The count is {counter}
)
}
}
const mapState = state => ({
counter: state.counter
})
const mapDispatch = ({ counter: { increment, incrementAsync } }) => ({
increment: () => increment(1),
incrementBy: amount => () => increment(amount),
incrementAsync: () => incrementAsync(1)
})
export default connect(
mapState,
mapDispatch
)(Home)