Closed nifanic closed 4 years ago
AFAIK onChange argument holds current value of string type.
onChange
string
If so, the signature should be—
(e: string) => void
… but the current onChange signature is—
(e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void
… because MuiPhoneNumberProps type extends standard TextFieldProps—
MuiPhoneNumberProps
TextFieldProps
// src/global.d.ts export type MuiPhoneNumberProps = TextFieldProps & { autoFormat?: boolean; countryCodeEditable?: boolean; defaultCountry?: string; disableAreaCodes?: boolean; disableCountryCode?: boolean; disableDropdown?: boolean; dropdownClass?: string; enableLongNumbers?: boolean; excludeCountries?: string[]; inputClass?: string; onlyCountries?: string[]; preferredCountries?: string[]; };
The original component is not offering type definitions. The above code snippets are from my codebase. Not an issue.
AFAIK
onChange
argument holds current value ofstring
type.If so, the signature should be—
… but the current
onChange
signature is—… because
MuiPhoneNumberProps
type extends standardTextFieldProps
—