Skip to content

chore: bump react-i18next from 17.0.15 to 18.0.1 - #1824

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

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

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github Nov 12, 2026

Copy link
Copy Markdown
Contributor

Bumps react-i18next from 17.0.15 to 18.0.1.

Changelog

Sourced from react-i18next's changelog.

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.

17.1.11

  • fix(Trans): with i18next 26.7.0 or later and debug: true, the variables of object children are no longer logged as missing. When Trans interpolates before parsing (with count, values, tOptions or interpolation.defaultVariables), its t() call leaves the placeholders of object children like {{ name }} for after parsing, and i18next 26.7 logs each of them as missed to pass in variable name, although the output is right: <Trans count={n}>Hello <b>{{ name }}</b>, you have {{ count }} messages.</Trans> logged it for name. Trans now passes a missingInterpolationHandler to that call that does what i18next does without one (it keeps the placeholder, and a variable passed as undefined becomes empty), so the output is unchanged. It does not with skipOnVariables: false, a missingInterpolationHandler of your own, an i18nFormat plugin, or an escape function that would change the placeholders of the children.

17.1.10

  • fix(Trans): markup inside an interpolated value is no longer parsed as translation markup. Trans interpolates values (and count, values in tOptions, or the whole string when there are no children) before it parses the string. With interpolation.escapeValue: false, or with an i18nFormat plugin (i18next-icu, i18next-mf2, i18next-fluent), which inserts values without escaping whatever escapeValue says, a value like <0 href="https://example.com">x</0> was rendered as component 0 with that href, overriding the props of the component, and <strong>x</strong> in a value became a real <strong>. Trans now escapes the values for this t() call (with a plugin, the string values in values) and decodes the entities after parsing, so such a value renders as text, and a " in a value no longer closes an attribute like <Item title="{{name}}" />. {{- var}} stays the explicit way for a translator to insert a value unescaped. As with shouldUnescape, entities written in these translations (for example &amp;) are now decoded instead of shown literally. Output with escapeValue: true and no plugin, with i18next-icu escapeVariables: true, and with children and no values or count is unchanged.
  • fix(IcuTrans): the same for IcuTrans with escapeValue: false or an i18nFormat plugin: a value like <0>x</0> no longer becomes the first component, and a value containing an entity like &amp; is no longer decoded a second time.

... (truncated)

Commits
  • bd80256 18.0.1
  • fbc404c changelog for 18.0.1
  • 6f76fa2 fix(types): declare @​types/react as an optional peer dependency, require i18n...
  • 6b76421 18.0.0
  • 16c6116 changelog for 18.0.0
  • 209c4be feat!: react-i18next 18, a major version for i18next 27
  • 5ca8c86 build
  • 76c1842 17.1.13
  • 4dd03fe changelog for 17.1.13
  • 2d792a4 fix(types): the react init options keep their types with i18next 27
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [react-i18next](https://github.com/i18next/react-i18next) from 17.0.15 to 18.0.1.
- [Changelog](https://github.com/i18next/react-i18next/blob/master/CHANGELOG.md)
- [Commits](i18next/react-i18next@v17.0.15...v18.0.1)

---
updated-dependencies:
- dependency-name: react-i18next
  dependency-version: 18.0.1
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot Bot added dependencies Pull requests that update a dependency file javascript Pull requests that update javascript code labels Nov 12, 2026
@termix-triage-bot termix-triage-bot Bot moved this to Open PRs in Termix Roadmap Nov 12, 2026
@termix-triage-bot

Copy link
Copy Markdown

AI review | Needs changes

Bumps react-i18next to v18.0.1. Routine dependency update with no visible security or functional risks.

  • major Core PRs should target the current dev-* branch, not main. If no dev-* branch exists yet, ignore this.

Reviewed 57cdbf6. AI can be wrong, a maintainer still decides. Comment /termix review to run it again.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file javascript Pull requests that update javascript code

Projects

Status: Open PRs

Development

Successfully merging this pull request may close these issues.

0 participants