Created
May 26, 2019 15:53
-
-
Save rafaelrozon/399bed2b10b35acf8793665afcb3137f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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