@igloo-ui/provider
v0.1.5
Published
Provider allows you to set the locale for all Igloo components that need it. This should be done by wrapping the entire application in the provider. There are also hooks available such as useLocale and useLocalizedStringFormatter.
Downloads
80
Readme
Provider
Provider allows you to set the locale for all Igloo components that need it. This should be done by wrapping the entire application in the provider. There are also hooks available such as useLocale and useLocalizedStringFormatter.
Installation
To install @igloo-ui/provider
in your project, you will need to run the following command using npm:
npm install @igloo-ui/provider
If you prefer Yarn, use the following command instead:
yarn add @igloo-ui/provider
Usage
Then to use the component in your code just import it!
import IglooProvider from '@igloo-ui/provider';
<IglooProvider locale="en-US">
const { locale } = useLocale();
<div>Here is the current locale: {locale}</div>;
</IglooProvider>