Created
June 4, 2023 13:06
-
-
Save popeating/c005eb7933020ac9527569715a9ea189 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import '../styles/globals.css'; | |
import { wrapper } from '../lib/store'; | |
import { PersistGate } from 'redux-persist/integration/react'; | |
import { useStore } from 'react-redux'; | |
function MyApp({ Component, pageProps }) { | |
const store = useStore(); | |
return ( | |
<PersistGate persistor={store.__persistor} loading={<div>Loading...</div>}> | |
<Component {...pageProps} /> | |
</PersistGate> | |
); | |
} | |
export default wrapper.withRedux(MyApp); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment