react-native-phone-number-input
react-native-phone-number-input copied to clipboard
Default Value is not working
Default Value prop is not working for me. Please help me!
<PhoneInput
ref={phoneInput}
defaultValue={phone}
value={phone}
defaultCode="DE"
layout="first"
placeholder="Emergency Phone Number*"
codeTextStyle={{
fontSize:
Platform.OS === "ios" ? normalize(10) : normalize(12),
color: colors.BLACK,
}}
textInputProps={{
fontSize:
Platform.OS === "ios" ? normalize(10) : normalize(12),
placeholderTextColor: "gray",
color: "black",
height: Platform.OS == "android" ? 40 : 20,
}}
containerStyle={{
backgroundColor: colors.WHITE,
borderColor:
phoneCheck && phone == null ? colors.ERROR : colors.BORDER,
borderRadius: 4,
borderWidth: 1,
width: "100%",
height: "5%",
marginBottom: "20%",
}}
textContainerStyle={{
backgroundColor: colors.WHITE,
height: "100%",
borderRadius: 0.6,
}}
// layout="first"
onChangeText={(text) => {
setPhoneNum(text);
}}
// onChangeFormattedText={(text) => {
// setFormattedValue(text);
// }}
/>
You can refer to #85. See if it helps
Check whether phone is string. It is worked for me when I added like this phone+''
any updates on this issue? I am facing the same issue.
any updates on this issue? I am facing the same issue.
https://github.com/garganurag893/react-native-phone-number-input/pull/111/commits/e3f258f6246f91a9d75f018b09f23b8564801cde
check the above pull-request for the fix.
any updates on this issue? I am facing the same issue.
check the above pull-request for the fix.
@infomazeapps Thanks It works.