Sourced from react-i18next's changelog.
17.0.15
- fix(Trans): empty paired component tags now preserve a component's single valid React-element child, whether supplied through a named component map (
<wrap></wrap>), a component array (<0></0>), or indexed JSX children (<1></1>). This matches the existing behavior for two or more children and self-closing tags. React represents one JSX child as an element and multiple children as an array; the previous array-only check silently rendered the one-child case empty. Compatibility note: when that sole element contains an interpolation object, the restored raw children can expose an existing React rendering limitation as an error instead of silently rendering empty; the same shape already errors with two children. Fixes #1932.17.0.14
- fix: the
i18nobject returned byuseTranslationwas only refreshed wheni18n.languagechanged, so aresolvedLanguage(orlanguages) change of its own kept handing components the previous snapshot. That happens whenever the translations for the current language arrive after the switch — i18next resolves to the fallback until its store has them — and components readingi18n.resolvedLanguage(language switchers, for example) then stayed one switch behind. The cached wrapper is now keyed on all three language fields, which are exactly the ones the surroundinguseMemoalready depends on; wrapper identity still only changes when the language state does, so the caching from #1885 is unaffected. Reported via next-i18next#2348.17.0.13
- fix(types): the selector-form
keyPrefixoverload ofuseTranslation()is now available underenableSelector: 'strict'.useTranslationwas gated ontrue | 'optimize'only, so under'strict'it resolved to the legacy signature and the selector overload disappeared entirely (keyPrefix: ($) => $.ns.foofailed withType '($: any) => any' is not assignable to type 'undefined').Transalready handled all three modes. Companion to the same fix forgetFixedTin i18next#2446. Thanks@hovelopin(#1930).
7d38e09
17.0.15875b327
fix(Trans): preserve single-element children in empty slots5f8c5f9
17.0.146def81a
fix: refresh the returned i18n wrapper when resolvedLanguage
changesf37ea87
docs: "For AI assistants" paragraph in the READMEe0592ba
chore: keep dev-only and local files out of the npm packageaddf646
17.0.137c634ee
changelog v17.0.135ceefb0
fix(types): allow selector keyPrefix in useTranslation under
enableSelector '...aa7ba52
chore(examples): require activesupport >= 7.2.3.1 in the RN
Gemfiles