Skip to content

Commit 0faccee

Browse files
committed
avoid exception when passing bindI18n: false #1856
1 parent 1584a44 commit 0faccee

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
### 15.6.1
2+
3+
avoid exception when passing bindI18n: false [1856](https://github.com/i18next/react-i18next/pull/1856)
4+
15
### 15.6.0
26

37
fix: passing components as object should still allow for indexed matching of children [1854](https://github.com/i18next/react-i18next/pull/1854)

react-i18next.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@
173173
return i18n.hasLoadedNamespace(ns, {
174174
lng: options.lng,
175175
precheck: (i18nInstance, loadNotPending) => {
176-
if (options.bindI18n?.indexOf('languageChanging') > -1 && i18nInstance.services.backendConnector.backend && i18nInstance.isLanguageChangingTo && !loadNotPending(i18nInstance.isLanguageChangingTo, ns)) return false;
176+
if (options.bindI18n && options.bindI18n.indexOf('languageChanging') > -1 && i18nInstance.services.backendConnector.backend && i18nInstance.isLanguageChangingTo && !loadNotPending(i18nInstance.isLanguageChangingTo, ns)) return false;
177177
}
178178
});
179179
};
@@ -715,7 +715,7 @@
715715
if (bindI18nStore) i18n?.store.on(bindI18nStore, boundReset);
716716
return () => {
717717
isMounted.current = false;
718-
if (i18n) bindI18n?.split(' ').forEach(e => i18n.off(e, boundReset));
718+
if (i18n && bindI18n) bindI18n?.split(' ').forEach(e => i18n.off(e, boundReset));
719719
if (bindI18nStore && i18n) bindI18nStore.split(' ').forEach(e => i18n.store.off(e, boundReset));
720720
};
721721
}, [i18n, joinedNS]);

0 commit comments

Comments
 (0)