Created
August 10, 2018 12:13
-
-
Save fulopdaniel/224a64afeb55cddd29d67f66e6cc0333 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