I'm currently facing issues while using the react-i18next
dependency with next.js.
Within my _app.js
file, I have the following code snippet:
if (!isServer) {
init_i18n();
}
function MyApp({ Component, pageProps }) {
// The presence of this if statement seems to be causing some issues!
if (i18n.isInitialized) {
return <Component {...pageProps} />;
} else {
return <></>;
}
}
Initially, when my _app.js
file did not include the if statement:
if (!isServer) {
init_i18n();
}
function MyApp({ Component, pageProps }) {
return <Component {...pageProps} />;
}
I encountered a different hydration error:
Warning: Text content did not match. Server: "navbar.dashboard" Client: "Dashboard"
Your assistance in resolving this issue would be greatly appreciated!