I have a custom input field for the phone number made from the library 'react-phone-input-2',
I will show the code for the custom input field made by a colleague
<PhoneInput
inputProps={{
name: inputName,
}}
country="lb"
value={phoneNumber}
placeholder="1234456"
onChange={phone => handleInputChange(inputName, phone)}
buttonClass="buttonarrow"
containerStyle={mainContainer}
inputStyle={phoneInput(countryCodeBtnWidth, isMobileScreen, hasError)}
buttonStyle={countryCodeBtn(countryCodeBtnWidth, isMobileScreen)}
dropdownStyle={dropDownList}
/>
When I import this and try to send formik to handle the handleInputOnChange I am not able to extract the values even though all other fields are being extracted in the same way.
I will post code for the extraction
<PhoneInputValidation
name="phoneNumber"
value={formik.phoneNumber}
handleInputChange={formik.handleChange}
hasError={
formik.errors.phoneNumber && formik.touched.phoneNumber
}
validationMessage={ERROR_REQUIRED}
onBlur={formik.handleBlur}
/>
phoneInputValidation is another component made from importing phoneInput the code is below
<ValidationModule hasError={hasError} validationMessage={validationMessage}>
<PhoneInputCustom
handleInputChange={handleInputChange}
hasError={hasError}
inputName={name}
phoneNumber={value}
/>
</ValidationModule>
ps: using formik.handleChange on other fields in the same form is working fine