rsnext/examples/with-redux-thunk/pages/_app.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

12 lines
284 B
JavaScript

import { Provider } from 'react-redux'
import { useStore } from '../store'
export default function App({ Component, pageProps }) {
const store = useStore(pageProps.initialReduxState)
return (
<Provider store={store}>
<Component {...pageProps} />
</Provider>
)
}