use-intl-hook
React
use-intl-hook
for react-intl.
Install
yarn add use-intl-hook
Usage
import 'intl';import React from 'react';import ReactDOM from 'react-dom';import IntlProvider addLocaleData from 'react-intl';import InjectIntlContext useIntl from 'use-intl-hook'; import locale messages from './i18n'; const Example = // call the useIntl hook to get the intl object from react-intl const intl = ; return <h1>intl</h1>;; // Include `InjectIntlContext` up in the tree to store the intl object from react-intlReactDOM;