Skip to content

Instantly share code, notes, and snippets.

@fulopdaniel
Created August 10, 2018 12:13
Show Gist options
  • Save fulopdaniel/224a64afeb55cddd29d67f66e6cc0333 to your computer and use it in GitHub Desktop.
Save fulopdaniel/224a64afeb55cddd29d67f66e6cc0333 to your computer and use it in GitHub Desktop.
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