Skip to content

chore(deps): bump react-i18next from 16.5.4 to 18.0.3 - #71

Closed
dependabot[bot] wants to merge 1 commit into
mainfrom
dependabot/npm_and_yarn/react-i18next-18.0.3
Closed

dependabot[bot] wants to merge 1 commit into
mainfrom
dependabot/npm_and_yarn/react-i18next-18.0.3

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Bumps react-i18next from 16.5.4 to 18.0.3.

Changelog

Sourced from react-i18next's changelog.

18.0.3

  • fix: Trans with children and values (or count) no longer fills a placeholder that came in with a value. The text t() returned was interpolated a second time after parsing, with all variables, so values={{ name: '{{otherVar}}', otherVar: 'x' }} rendered x instead of {{otherVar}}, and a value containing its own placeholder was filled twice. interpolation.skipOnVariables now holds as in t(). Text that t() did not interpolate (cimode, a t that returns the key, a format plugin, skipInterpolation) is still filled after parsing (#1950)

18.0.2

  • fix: useTranslation, Trans and IcuTrans re-render for a bindI18nStore event that fires after they rendered but before they subscribed (a bundle added in a parent's layout effect, for example). They kept the old text, because only the events their own subscription received changed their snapshot (#1949)

18.0.1

  • fix(types): declare @types/react as an optional peer dependency. The type declarations import from react, and with pnpm's global virtual store (virtualStoreType: global) TypeScript resolved that to the untyped react/index.js, so every React type in them became any: wrong props compiled, callback parameters failed with TS7006. Under the default pnpm layout it only worked through pnpm's hidden hoisting. The range is *, so projects without TypeScript install nothing extra and an older @types/react does not make npm fail (#1948)
  • requires i18next 27.0.1 or later (peer >= 27.0.1), which keeps at most 1000 formatters in each cached format

18.0.0

Released together with i18next 27. The migration guide lists every change with what to do: https://react.i18next.com/latest/migrating-v17-to-v18

Breaking changes

  • requires i18next 27 (peer >= 27.0.0) and React 18 or later (peer >= 18.0.0). React 16 and 17 apps stay on react-i18next 17: on i18next 27, use react-i18next 17.1.13 or later (it brings the types of the react init options), or 18. useSyncExternalStore comes from React itself, so use-sync-external-store is no longer a dependency.
  • Trans output no longer depends on interpolation.escapeValue: it always decodes HTML entities after parsing, as IcuTrans does, in text and in attribute values, both with react.unescape (attribute values used the built-in decoder before). With i18next's default escapeValue: true, a value Tom & Jerry rendered as Tom & Jerry and a date 17/12/2025 as 17/12/2025; both now render as written, and so do entities in the translation itself (&, <,  , ...). Values still render as text, never as markup (since 17.1.10). The shouldUnescape prop and react.transDefaultProps.shouldUnescape are ignored and warn (DEPRECATED_OPTION, in development and with debug: true); remove them. Snapshot tests that contain entities inside Trans output need an update (#1903, #1893).
  • Trans and IcuTrans re-render on language change by themselves: they subscribe to the react.bindI18n (default languageChanged) and react.bindI18nStore events, like useTranslation. Before, they only updated when a parent re-rendered (#1710). They still neither load translations nor suspend; with a t prop, that t still decides the language. TransWithoutContext and IcuTransWithoutContext stay hook-free.
  • the react options of an instance stay on that instance. initReactI18next copied them into module-wide defaults, so a second instance without react options inherited, for example, the first one's useSuspense: false. Set them on every instance, or call setDefaults() once.
  • the i18n returned by useTranslation (and passed by withTranslation and Translation) forwards reads and writes to the instance. It was a copy taken when the language changed, so after await i18n.changeLanguage('de') the copy still said en, and properties set on it never reached the instance. It is still a new object whenever the language changes, for dependency arrays and the React Compiler. Because the old object now reads the current language too, a check like prevProps.i18n.language !== this.props.i18n.language (or the language of a usePrevious(i18n)) no longer sees a change: compare the objects (prevProps.i18n !== this.props.i18n) or keep the previous language yourself.
  • useSSR and withSSR call i18next's hydrate() instead of writing resourceStore.data, options.ns, initializedStoreOnce, isInitialized and initializedLanguageOnce themselves. Same behavior with real instances, including the opt-out for cloned instances. Test mocks of i18n used with useSSR/withSSR now need a hydrate method, mocks that load before init() need once, and mocks used with Trans or IcuTrans need on and off, since both subscribe to events now (with bindI18nStore set, also store.on and store.off): a minimal mock like { t, options, language } throws i18n.on is not a function.
  • the react-i18next/icu.macro Babel macro (deprecated since 17.0.21) is removed, with the placeholder exports date, time, number, select, plural and selectOrdinal. Write IcuTrans directly.
  • types: the HTMLAttributes['children'] augmentation for allowObjectInHTMLChildren moved to the opt-in react-i18next/augment-react. Default installs no longer change React's DOM types. With allowObjectInHTMLChildren: true, add import 'react-i18next/augment-react'; next to your CustomTypeOptions; with current @types/react it needs skipLibCheck: true (#1928).
  • types: I18nContext is typed { i18n: i18n; defaultNS?: string | string[] } | undefined, as at runtime: useContext(I18nContext) is undefined outside an I18nextProvider. getI18n() keeps its type.
  • types: react-i18next now declares the react init options. i18next 27 keeps an empty ReactOptions interface that react-i18next fills in, so import type { ReactOptions } from 'i18next' keeps working, and ReactOptions is also exported from react-i18next. The defaultTransParent docs no longer claim a 'div' default.
  • the UMD build no longer bundles i18next: it uses the global i18next (load i18next's UMD build first) and shrinks from 71.3 KB to 26.2 KB minified. The AMD build (dist/amd) is removed; AMD loaders can use the UMD file.
  • engines.node is >=22, and the build targets ES2020 syntax with a fixed browser list instead of browserslist defaults.

Other changes

  • feat: a react-server export condition for react-i18next. In a React Server Component, import { Trans } from 'react-i18next' failed with createContext is not a function; it now resolves to an entry with Trans and IcuTrans (the variants without React context), TransWithoutContext, IcuTransWithoutContext, nodesToString, initReactI18next, setI18n/getI18n and setDefaults/getDefaults. Hooks, HOCs, Translation, I18nextProvider and the SSR helpers stay client-only, so importing them there is a build error. Without an i18n prop, the server Trans and IcuTrans use the global instance (the one initReactI18next registered), which is the wrong one with an instance per request: pass that instance as i18n (t is optional). A t alone is not enough, because a t from getFixedT carries no instance. In development and with debug: true they warn about it (GLOBAL_INSTANCE_ON_SERVER) (#1759, #1840).
  • fix(Trans): a component given for a self-closing tag (<0/>) with children of its own is no longer remounted on every render. Trans created a new component type for it each time, so its state and effects were reset.
  • fix: warnings are deduplicated per i18next instance instead of once per process, so a second instance reports its own problems. Clones (cloneInstance(), for example one per request in i18next-http-middleware) share their parent's, as they share its logger, so they do not repeat them.
  • fix: a translation load waiting for init() uses i18n.once('initialized') instead of removing its listener with a delay.
  • fix(types): with keySeparator: false and a key prefix (useTranslation(ns, { keyPrefix }), getFixedT), the values of Trans and IcuTrans are typed from the right key. The prefix and the key were joined with the text false (nestedfalsec), so no variables were checked; they are now joined with ., as getFixedT does.
  • fix(types): useSSR takes its third argument { i18n }, and the useTranslation options take bindI18nStore, as at runtime. ErrorCode lists I18N_NOT_INITIALIZED, ICU_TRANS_RENDER_ERROR and GLOBAL_INSTANCE_ON_SERVER.
  • chore: a files whitelist replaces .npmignore; @babel/runtime is no longer a dependency.

17.1.13

  • fix(types): the react init options keep their types with i18next 27. i18next 27 declares ReactOptions (the type of i18next.init({ react })) as an empty interface and leaves its shape to react-i18next, so with react-i18next 17 the react options were no longer checked and getDefaults().useSuspense did not compile. react-i18next now declares them itself, with exactly the types i18next 26 has: TypeScript accepts the repeated declaration on i18next 26, and on i18next 27 it fills in the empty interface. Nothing changes with i18next 26.

17.1.12

  • fix(types): type-checking a <Trans> is fast again with large resources. Since 17.0.2 the return type of the key was a type parameter of Trans, so TypeScript also computed it for every key of the namespace: with 50 namespaces of 200 keys, one <Trans> cost about 1.3 million more type instantiations than in 17.0.1, with or without a values prop. The return type is computed inside the values prop again, as in 17.0.1, and values still only needs the variables of the given i18nKey (#1913). The exported TransProps type loses the Ret parameter added in 17.0.2, so its 6th parameter is the element props E again, as before 17.0.2. Thanks @​leshaduduk (#1947), fixes #1946.

... (truncated)

Commits

@dependabot dependabot Bot added dependabot Dependabot: dependabot dependencies Dependabot: dependencies npm Dependabot: npm labels Nov 22, 2026
@dependabot
dependabot Bot force-pushed the dependabot/npm_and_yarn/react-i18next-18.0.3 branch from a14b1d9 to 8cb3f53 Compare November 23, 2026 17:01
Bumps [react-i18next](https://github.com/i18next/react-i18next) from 16.5.4 to 18.0.3.
- [Changelog](https://github.com/i18next/react-i18next/blob/master/CHANGELOG.md)
- [Commits](i18next/react-i18next@v16.5.4...v18.0.3)

---
updated-dependencies:
- dependency-name: react-i18next
  dependency-version: 18.0.3
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot
dependabot Bot force-pushed the dependabot/npm_and_yarn/react-i18next-18.0.3 branch from 8cb3f53 to 9cd731f Compare November 23, 2026 18:36
karlspace added a commit that referenced this pull request Nov 23, 2026
Packages that must move together arrived as separate Dependabot PRs,
each of which is broken or dangerous on its own:

* react: #67 bumped react to 19.3.1 while react-dom stayed at 19.2.4;
  react-dom throws "Incompatible React versions" at startup unless
  both share the exact same version (CI was green, runtime was not)
* vite: #52 (vite 8) and #50 (@vitejs/plugin-react 6) each fail
  `npm ci` with ERESOLVE, because plugin-react 6 needs vite 8 and
  plugin-react 5 / vite-plugin-pwa 1 cap vite at ^7
* i18next: react-i18next 18 (#71) needs i18next >= 27 (#70)

Added react, vite, i18next and radix-ui groups ahead of the existing
dev/production groups. Dependabot assigns a dependency to the first
group it matches, and these groups also take major updates, so the
pairs always arrive in one PR. The radix-ui group bundles the
primitives that share internal packages (6 separate PRs last week).

The github-actions entry gets a catch-all group as well, which
collapses the five separate action PRs (#20, #21, #25, #28, #29).

The grouped Vite 8 PR still needs the vite.config.ts change from
#52 (lowercase build target, function-form manualChunks) on main.
@dependabot @github

dependabot Bot commented on behalf of github Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #76.

@dependabot dependabot Bot closed this Nov 23, 2026
@dependabot
dependabot Bot deleted the dependabot/npm_and_yarn/react-i18next-18.0.3 branch November 23, 2026 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependabot Dependabot: dependabot dependencies Dependabot: dependencies npm Dependabot: npm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants