PhoneInput: remove unnecessary handleCountryChange function

environments/review-phone-inpu-3kvl0k/deployments/542
Alex Gleason 2022-07-13 18:10:16 -05:00
rodzic ba98a8e82f
commit 0591bf72a5
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
1 zmienionych plików z 1 dodań i 5 usunięć

Wyświetl plik

@ -24,10 +24,6 @@ const PhoneInput: React.FC<IPhoneInput> = (props) => {
const [countryCode, setCountryCode] = useState<CountryCode>(defaultCountryCode);
const [nationalNumber, setNationalNumber] = useState<string>('');
const handleCountryChange = (code: CountryCode) => {
setCountryCode(code);
};
const handleChange: React.ChangeEventHandler<HTMLInputElement> = ({ target }) => {
// HACK: AsYouType is not meant to be used this way. But it works!
const asYouType = new AsYouType({ defaultCallingCode: countryCode });
@ -64,7 +60,7 @@ const PhoneInput: React.FC<IPhoneInput> = (props) => {
<HStack alignItems='center'>
<CountryCodeDropdown
countryCode={countryCode}
onChange={handleCountryChange}
onChange={setCountryCode}
/>
<Input