@visma/react-intl-bundled-messages
v1.3.1
Published
`IntlProvider` that lazy loads messages in current language in Webpack environment.
Downloads
347
Readme
@visma/react-intl-bundled-messages
IntlProvider
that lazy loads messages in current language in Webpack environment.
Usage
Add module resolve alias. In Webpack config:
import bundledMessagesWebpackAlias from '@visma/react-intl-bundled-messages/lib/webpackAlias.js'; export default { //... resolve: { alias: { ...bundledMessagesWebpackAlias(mode), }, }, };
Build messages using @visma/formatjs-scripts
Add
IntlProvider
:import { IntlProvider } from '@visma/react-intl-bundled-messages'; function App() { return <IntlProvider>...</IntlProvider>; }