Skip to content

Commit

Permalink
rebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
jamuhl committed Mar 22, 2019
1 parent e4e59a5 commit b251e68
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### 10.5.3

- Fix the displayName of HOC components [798](https://github.com/i18next/react-i18next/pull/798)

### 10.5.2

- fixes: transSupportBasicHtmlNodes doesn't work with self-closing Trans [790](https://github.com/i18next/react-i18next/issues/790)
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.5.2",
"version": "10.5.3",
"description": "Internationalization for react done right. Using the i18next i18n ecosystem.",
"main": "dist/commonjs/index.js",
"types": "src/index.d.ts",
Expand Down
5 changes: 5 additions & 0 deletions react-i18next.js
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,9 @@
if (loadNotPending(lng, ns) && (!fallbackLng || loadNotPending(lastLng, ns))) return true;
return false;
}
function getDisplayName(Component) {
return Component.displayName || Component.name || (typeof Component === 'string' && Component.length > 0 ? Component : 'Unknown');
}

function hasChildren(node) {
return node && (node.children || node.props && node.props.children);
Expand Down Expand Up @@ -807,6 +810,7 @@
}));
}

I18nextWithTranslation.displayName = `withI18nextTranslation(${getDisplayName(WrappedComponent)})`;
return I18nextWithTranslation;
};
}
Expand Down Expand Up @@ -871,6 +875,7 @@
}

I18nextWithSSR.getInitialProps = composeInitialProps(WrappedComponent);
I18nextWithSSR.displayName = `withI18nextSSR(${getDisplayName(WrappedComponent)})`;
return I18nextWithSSR;
};
}
Expand Down
Loading

0 comments on commit b251e68

Please sign in to comment.