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

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.