Skip to content

Commit

Permalink
fix fallback of t function in Trans component
Browse files Browse the repository at this point in the history
  • Loading branch information
adrai committed Jan 7, 2023
1 parent c997603 commit 0cceb90
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### 12.1.3

- fix fallback of t function in Trans component

### 12.1.2

- fix crash in gatsby [1594](https://github.com/i18next/react-i18next/issues/1594)
Expand Down
6 changes: 1 addition & 5 deletions react-i18next.js
Original file line number Diff line number Diff line change
Expand Up @@ -807,11 +807,7 @@
defaultNSFromContext = _ref2.defaultNS;

var i18n = i18nFromProps || i18nFromContext || getI18n();

var t = tFromProps || i18n && i18n.t.bind(i18n) || function (k) {
return k;
};

var t = tFromProps || i18n && i18n.t.bind(i18n);
return Trans(_objectSpread2({
children: children,
count: count,
Expand Down
2 changes: 1 addition & 1 deletion react-i18next.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/Trans.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export function Trans({
const { i18n: i18nFromContext, defaultNS: defaultNSFromContext } = useContext(I18nContext) || {};
const i18n = i18nFromProps || i18nFromContext || getI18n();

const t = tFromProps || (i18n && i18n.t.bind(i18n)) || ((k) => k);
const t = tFromProps || (i18n && i18n.t.bind(i18n));

return TransWithoutContext({
children,
Expand Down

0 comments on commit 0cceb90

Please sign in to comment.