I have error when combine appWithTranslation
and PersistGate
:
Unhandled Runtime Error
NotFoundError: The object can not be found here.
My code:
import { appWithTranslation } from 'next-i18next'
import { Provider } from 'react-redux'
import { persistStore } from 'redux-persist'
import { PersistGate } from 'redux-persist/integration/react'
import { useStore } from '../store'
const MyApp = ({ Component, pageProps }) => {
const store = useStore(pageProps.initialReduxState)
const persistor = persistStore(store, {}, () => { persistor.persist() })
return (
<Provider store={store}>
<PersistGate loading={<div>loading</div>} persistor={persistor}>
<Component { ...pageProps } />
</PersistGate>
</Provider>
)
}
export default appWithTranslation(MyApp)
Firstly it loading successfully, but when I change locale I get error.
And no traceback! Just stops working -- components are not displayed, only loading
(from PersistGate)