in React JS by
Q:

How to access current locale with React Intl?

1 Answer

0 votes
by

You can get the current locale in any component of your application using injectIntl():

import { injectIntl, intlShape } from 'react-intl'

const MyComponent = ({ intl }) => (
  <div>{`The current locale is ${intl.locale}`}</div>
)

MyComponent.propTypes = {
  intl: intlShape.isRequired
}

export default injectIntl(MyComponent)
Click here to read more about React JS
Click here to read more about Insurance

Related questions

0 votes
asked Mar 3, 2020 in React JS by miceperry
0 votes
asked Mar 1, 2020 in React JS by RShastri
0 votes
asked Jan 30 in React JS by rajeshsharma
0 votes
0 votes
asked Mar 4, 2020 in React JS by JackTerrance
0 votes
0 votes
asked Mar 3, 2020 in React JS by miceperry
+1 vote
...