Fix i18n: move init to root.tsx and downgrade to stable versions
Move initI18n() from entry.client.tsx to root.tsx in both Planner and Journal so i18n is initialized before any component renders. Downgrade react-i18next to 16.6.1 and i18next to 25.10.4 to avoid hydration mismatch issues introduced in newer versions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
30ae68dd69
commit
3f7499ff06
7 changed files with 252 additions and 248 deletions
|
|
@ -1,4 +1,3 @@
|
|||
import { initI18n } from "@trails-cool/i18n";
|
||||
import * as Sentry from "@sentry/react";
|
||||
import { useEffect } from "react";
|
||||
import { startTransition, StrictMode } from "react";
|
||||
|
|
@ -28,8 +27,6 @@ Sentry.init({
|
|||
enabled: import.meta.env.PROD && sentryEnvironment !== "ci",
|
||||
});
|
||||
|
||||
initI18n();
|
||||
|
||||
startTransition(() => {
|
||||
hydrateRoot(
|
||||
document,
|
||||
|
|
|
|||
|
|
@ -4,9 +4,12 @@ import type { LinksFunction } from "react-router";
|
|||
import type { Route } from "./+types/root";
|
||||
import * as Sentry from "@sentry/react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { initI18n } from "@trails-cool/i18n";
|
||||
import { getSessionUser } from "~/lib/auth.server";
|
||||
import stylesheet from "@trails-cool/ui/styles.css?url";
|
||||
|
||||
initI18n();
|
||||
|
||||
export const links: LinksFunction = () => [{ rel: "stylesheet", href: stylesheet }];
|
||||
|
||||
export function Layout({ children }: { children: React.ReactNode }) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue