Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

forkingbeardman's avatar

forkingbeardman wrote a reply+100 XP

3mos ago

React + InertiaJS InfiniteScroll Issue

nope, not really, did not have time to dig deeper into the issue, stuck with the "old school" method. haven't checked if maybe latest updates fixed it.

forkingbeardman's avatar

forkingbeardman wrote a reply+100 XP

4mos ago

Inertia/React SSR - i18n Language flicker Issue

this was one of the solutions i tried and it does not eliminate the issue and the SSR still only renders in English and then gets hydrated with Georgian

forkingbeardman's avatar

forkingbeardman started a new conversation+100 XP

4mos ago

Inertia/React SSR - i18n Language flicker Issue

Hi, i have run into the following issue after adding SSR support to my app, the server rendered html stays in English but later is hydrated with whatever user has selected. this causes slight flicker of text during refresh (and seo not indexing correct html). i have tried many solutions and none have solved the underlying problem.

in my Layout.jsx i have following code:

useEffect(() => {
        if (locale && locale !== i18n.language) {
            i18n.changeLanguage(locale);
        }
    }, [locale]);

if i remove this, only enlgish is loaded

my app.jsx looks like this:

createInertiaApp({
    title: (title) => (title ? `${title} - ${appName}` : appName),
    resolve: (name) =>
        resolvePageComponent(
            `./Pages/${name}.jsx`,
            import.meta.glob("./Pages/**/*.jsx"),
        ),
    setup: ({ el, App, props }) => {
        const locale = props.initialPage.props.locale;
        if (locale) {
            i18n.changeLanguage(locale);
        }
        hydrateRoot(
            el,
            <React.StrictMode>
                <App {...props} />
            </React.StrictMode>,
        );
    },
    progress: {
        color: "#4B5563",
    },
});

the ssr.jsx:

and the i18n config:

import i18n from "i18next";
import { initReactI18next } from "react-i18next";

import en from "./Locales/en.json";
import ka from "./Locales/ka.json";

i18n.use(initReactI18next).init({
    resources: {
        en: { translation: en },
        ka: { translation: ka },
    },
    lng: "ka",
    fallbackLng: "ka",
    interpolation: {
        escapeValue: false,
    },
});

export default i18n;

what am i doing wrong here? any help is much appreciated