Skip to content

Commit 1e1bf1c

Browse files
committedMar 26, 2021
rebuild
1 parent e83da8a commit 1e1bf1c

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed
 

‎CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
### 11.8.12
2+
3+
- refactor: remove unneeded object [1286](https://github.com/i18next/react-i18next/pull/1286)
4+
15
### 11.8.11
26

37
- typescript: Bug fixes [1284](https://github.com/i18next/react-i18next/pull/1284)

‎react-i18next.js

+7-9
Original file line numberDiff line numberDiff line change
@@ -819,12 +819,10 @@
819819
});
820820

821821
function getT() {
822-
return {
823-
t: i18n.getFixedT(null, i18nOptions.nsMode === 'fallback' ? namespaces : namespaces[0])
824-
};
822+
return i18n.getFixedT(null, i18nOptions.nsMode === 'fallback' ? namespaces : namespaces[0]);
825823
}
826824

827-
var _useState = React.useState(getT()),
825+
var _useState = React.useState(getT),
828826
_useState2 = _slicedToArray(_useState, 2),
829827
t = _useState2[0],
830828
setT = _useState2[1];
@@ -837,12 +835,12 @@
837835

838836
if (!ready && !useSuspense) {
839837
loadNamespaces(i18n, namespaces, function () {
840-
if (isMounted.current) setT(getT());
838+
if (isMounted.current) setT(getT);
841839
});
842840
}
843841

844842
function boundReset() {
845-
if (isMounted.current) setT(getT());
843+
if (isMounted.current) setT(getT);
846844
}
847845

848846
if (bindI18n && i18n) i18n.on(bindI18n, boundReset);
@@ -860,13 +858,13 @@
860858
var isInitial = React.useRef(true);
861859
React.useEffect(function () {
862860
if (isMounted.current && !isInitial.current) {
863-
setT(getT());
861+
setT(getT);
864862
}
865863

866864
isInitial.current = false;
867865
}, [i18n]);
868-
var ret = [t.t, i18n, ready];
869-
ret.t = t.t;
866+
var ret = [t, i18n, ready];
867+
ret.t = t;
870868
ret.i18n = i18n;
871869
ret.ready = ready;
872870
if (ready) return ret;

‎react-i18next.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
Please sign in to comment.