rsnext/examples/with-redux-thunk/components/examples.js
Ravinder Mahajan 1c31d79c38 Creating one more example which only uses redux and no thunk as middl… (#6636)
Adding one more example which only uses redux and not thunk. This helps a lot for a beginner to understand basic redux first.
2019-03-14 17:40:00 +01:00

19 lines
411 B
JavaScript

import { connect } from 'react-redux'
import Clock from './clock'
import Counter from './counter'
function Examples ({ lastUpdate, light }) {
return (
<div>
<Clock lastUpdate={lastUpdate} light={light} />
<Counter />
</div>
)
}
function mapStateToProps (state) {
const { lastUpdate, light } = state
return { lastUpdate, light }
}
export default connect(mapStateToProps)(Examples)