1c31d79c38
Adding one more example which only uses redux and not thunk. This helps a lot for a beginner to understand basic redux first.
19 lines
411 B
JavaScript
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)
|