23 lines
673 B
JavaScript
23 lines
673 B
JavaScript
//import "../styles/globals.css";
|
|
import "../styles/sass/styles.scss";
|
|
import Loading from "../components/loading";
|
|
import { wrapper } from "../store/store";
|
|
import { useStore } from "react-redux";
|
|
import { persistStore } from "redux-persist";
|
|
import { PersistGate } from "redux-persist/integration/react";
|
|
|
|
const MyApp = ({ Component, pageProps }) => {
|
|
const store = useStore((state) => state);
|
|
const persistor = persistStore(store, {}, function () {
|
|
persistor.persist();
|
|
});
|
|
|
|
return (
|
|
<PersistGate persistor={store.__persistor} loading={<Loading />}>
|
|
<Component {...pageProps} />
|
|
</PersistGate>
|
|
);
|
|
};
|
|
|
|
export default wrapper.withRedux(MyApp);
|