rsnext/examples/with-redux-thunk/pages/show-redux-state.js
Todor Totev 11597655d9
Enhance with redux thunk example (#13576)
* Refactored the store so that it doesnt use getInitialProps

* Applied the changes in the _app file

* Refactored the wrapper so that it uses the new store flow

* Removed the old redux syntax

Instead of passing the state from the parent component, I have used the new redux hooks to retrieve the current state.

* The clock no longer requires state to be passed too

* Updated the variable names

* forgot to bring back hot reloading

* Applied requested change.
2020-05-31 11:53:01 -05:00

27 lines
499 B
JavaScript

import { useSelector } from 'react-redux'
import Link from 'next/link'
const codeStyle = {
background: '#ebebeb',
width: 400,
padding: 10,
border: '1px solid grey',
marginBottom: 10,
}
const ShowReduxState = () => {
const state = useSelector((state) => state)
return (
<>
<pre style={codeStyle}>
<code>{JSON.stringify(state, null, 4)}</code>
</pre>
<Link href="/">
<a>Go Back Home</a>
</Link>
</>
)
}
export default ShowReduxState