Created
August 10, 2018 12:11
-
-
Save fulopdaniel/4e7d9080f205adfaa73dbbfb689be907 to your computer and use it in GitHub Desktop.
This file contains 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 { intlShape, injectIntl, defineMessages } from 'react-intl'; | |
const translations = defineMessages({ | |
hello: { | |
id: 'app.hello_world', | |
defaultMessage: 'Hello World!', | |
}, | |
}); | |
class TestComponent extends React.Component { | |
static propTypes = { | |
intl: intlShape.isRequired, | |
} | |
render() { | |
return( | |
{this.props.intl.formatMessage(translations.hello)} | |
) | |
} | |
} | |
export default injectIntl(TestComponent) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment