Home > mui-country-code-selector > useCountryCodeStore
This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
A custom hook that returns a country code store. Store is fetched from a React context and therefore the component using this hook is expected to be surrounded by CountryCodeStoreProvider
tags.
Signature:
useCountryCodeStore: () => Pick<CCSelectorState, "phoneNumStr" | "countryCodeValue" | "countries" | "errorMsg" | "errorMsgDelay" | "errorMsgTimeoutObj" | "phoneNumberInput" | "clearedRerender" | "setPhoneNumberInput" | "setRefs" | "initialize" | "cleanUp" | "handlePhoneNumberChange" | "handleCountryCodeChange" | "handleValueChange" | "placeInputSelection">
Returns:
Pick<CCSelectorState, “phoneNumStr” | “countryCodeValue” | “countries” | “errorMsg” | “errorMsgDelay” | “errorMsgTimeoutObj” | “phoneNumberInput” | “clearedRerender” | “setPhoneNumberInput” | “setRefs” | “initialize” | “cleanUp” | “handlePhoneNumberChange” | “handleCountryCodeChange” | “handleValueChange” | “placeInputSelection”>