Guest User

Untitled

a guest
Aug 17th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. /* @flow */
  2.  
  3. import React from 'react'
  4. import messages from '../messages'
  5. import { injectIntl } from 'react-intl'
  6. import type { IntlShape } from 'react-intl'
  7.  
  8. type Props = {|
  9. children: React.Node,
  10. intl: IntlShape,
  11. |}
  12.  
  13. export class Foo extends React.Component<Props> {
  14. render() {
  15. const { formatMessage } = this.props.intl
  16.  
  17. return (
  18. <React.Fragment>
  19. <h1>{formatMessage(messages.something)}</h1>
  20. {this.props.children}
  21. </React.Fragment>
  22. )
  23. }
  24. }
  25.  
  26. export default injectIntl(Foo)
Add Comment
Please, Sign In to add comment