File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 55import { type ReactNode , use , useEffect } from 'react' ;
66import dynamic from 'next/dynamic' ;
77import { PersistGate } from 'redux-persist/integration/react' ;
8- import { persistStore } from 'redux-persist' ;
9- import { store } from '../../store/store' ;
8+ import { persistor } from '../../store/store' ;
109import { useAppDispatch } from '../../hooks' ;
1110import { resetProfileErrors } from '../../store/profile-reducer' ;
1211
1312const App = dynamic ( async ( ) => await import ( '../../App' ) , { ssr : false } ) ;
1413
15- const persistor = persistStore ( store ) ;
16-
1714interface PageProps {
1815 params : Promise < {
1916 locale : string ;
Original file line number Diff line number Diff line change 11import {
22 persistReducer ,
3+ persistStore ,
34 FLUSH ,
45 REHYDRATE ,
56 PAUSE ,
@@ -83,6 +84,11 @@ if (typeof window !== 'undefined' && (window as any).Cypress) {
8384
8485sagaMiddleware . run ( rootSaga ) ;
8586
87+ // Create the persistor at the store level so rehydration and
88+ // state-persistence happen on every page load, not just on the
89+ // legacy catch-all route.
90+ export const persistor = persistStore ( store ) ;
91+
8692export type RootState = ReturnType < typeof store . getState > ;
8793export type AppDispatch = typeof store . dispatch ;
8894export type AppThunk < ReturnType = void > = ThunkAction <
You can’t perform that action at this time.
0 commit comments