Skip to content

Instantly share code, notes, and snippets.

@rafaelrozon
Created May 26, 2019 15:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rafaelrozon/399bed2b10b35acf8793665afcb3137f to your computer and use it in GitHub Desktop.
Save rafaelrozon/399bed2b10b35acf8793665afcb3137f to your computer and use it in GitHub Desktop.
import React from 'react';
import getDisplayName from 'react-display-name';
import { withNamespaces } from 'react-i18next';
const translate = (WrappedComponent) => {
class Container extends React.Component {
static displayName = `TranslateContainer(${getDisplayName(WrappedComponent)})`;
render() {
return (
<WrappedComponent {...this.props} />
);
}
}
return withNamespaces()(Container);
};
export default translate;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment