Skip to content

Instantly share code, notes, and snippets.

@popeating
Created June 4, 2023 13:06
Show Gist options
  • Save popeating/c005eb7933020ac9527569715a9ea189 to your computer and use it in GitHub Desktop.
Save popeating/c005eb7933020ac9527569715a9ea189 to your computer and use it in GitHub Desktop.
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