rsnext/examples/with-redux-thunk/components/examples.js
matamatak ab95c6d9a1 Updated with-redux-thunk example using useSelector and useDispatch (#8396)
* use useSelector and useDispatch

* update README

* fix space and trailing comma
2019-08-16 14:50:46 -05:00

15 lines
347 B
JavaScript

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