11597655d9
* 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.
27 lines
499 B
JavaScript
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
|