useCountry
The useCountry
hook returns a tuple of the current localization country and a function for updating it.
It must be a descendent of a LocalizationProvider
component.
Example code
Anchor link to section titled "Example code"
Return value
Anchor link to section titled "Return value"This hook returns an array with the following elements:
Index | Description |
---|---|
0 |
An object with the country's isoCode and name . |
1 |
A function for updating the country. Accepts one object as an argument with the keys isoCode and name . |