Skip to content

Commit

Permalink
fix using defaults in Trans
Browse files Browse the repository at this point in the history
  • Loading branch information
jamuhl committed Apr 8, 2019
1 parent 4fc5360 commit 69e4973
Show file tree
Hide file tree
Showing 5 changed files with 13 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 @@
### 10.6.2

- Fix Trans component ignore default options [818](https://github.com/i18next/react-i18next/pull/818)

### 10.6.1

- useTranslation useEffect also guard against unmounted for bound events...seems unmount and actual call to useEffect cleanup are not in correct order (component is first unmounted and then unbound - should be vice versa)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-i18next",
"version": "10.6.1",
"version": "10.6.2",
"description": "Internationalization for react done right. Using the i18next i18n ecosystem.",
"main": "dist/commonjs/index.js",
"types": "src/index.d.ts",
Expand Down
6 changes: 4 additions & 2 deletions react-i18next.js
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,9 @@
}

const t = tFromProps || i18n.t.bind(i18n);
const reactI18nextOptions = i18n.options && i18n.options.react || {};

const reactI18nextOptions = _objectSpread({}, getDefaults(), i18n.options && i18n.options.react);

const useAsParent = parent !== undefined ? parent : reactI18nextOptions.defaultTransParent;
const defaultValue = defaults || nodesToString('', children, 0, reactI18nextOptions) || reactI18nextOptions.transEmptyNodeValue;
const hashTransKey = reactI18nextOptions.hashTransKey;
Expand Down Expand Up @@ -722,7 +724,7 @@
if (i18n && !i18n.reportNamespaces) i18n.reportNamespaces = new ReportNamespaces();

if (!i18n) {
warnOnce('You will need pass in an i18next instance by using i18nextReactModule');
warnOnce('You will need pass in an i18next instance by using initReactI18next');
const retNotReady = [k => k, {}, true];

retNotReady.t = k => k;
Expand Down
Loading

0 comments on commit 69e4973

Please sign in to comment.