diff --git a/src/Trans.js b/src/Trans.js index 649196003..c731f10eb 100644 --- a/src/Trans.js +++ b/src/Trans.js @@ -1,6 +1,6 @@ import React, { useContext } from 'react'; import HTML from 'html-parse-stringify2'; -import { getI18n, getHasUsedI18nextProvider, I18nContext } from './context'; +import { getI18n, getHasUsedI18nextProvider, I18nContext, getDefaults } from './context'; import { warn, warnOnce } from './utils'; function hasChildren(node) { @@ -204,7 +204,8 @@ export function Trans({ const t = tFromProps || i18n.t.bind(i18n); - const reactI18nextOptions = (i18n.options && i18n.options.react) || {}; + const options = (i18n.options && i18n.options.react) || {}; + const reactI18nextOptions = { ...getDefaults(), ...options }; const useAsParent = parent !== undefined ? parent : reactI18nextOptions.defaultTransParent; const defaultValue = diff --git a/src/context.js b/src/context.js index f0069f750..1fc7d8a63 100644 --- a/src/context.js +++ b/src/context.js @@ -58,8 +58,6 @@ export const initReactI18next = { type: '3rdParty', init(instance) { - setDefaults(instance.options.react); - instance.options.react = getDefaults(); setI18n(instance); }, };