<PhoneInput
ref={(ref) => {
this.phoneInput = ref
}}
defaultValue={this.state.inputMobile}
onChangeText={(text) => {
this.setState({ inputMobile: text });
var checkValid = this.phoneInput.isValidNumber(JSON.stringify(this.state.inputMobile));
alert(checkValid)
}}
defaultCode="QA"
layout="second"
disableArrowIcon="true"
placeholder="Enter Mobile Number"
onChangeFormattedText={(text) => {
this.setState({ inputMobile: text });
}}
/>
I am trying to validate the phone number, on onChangeText method, but whenever I typing a indian phone number +91 9867587654
When I reached to 11 digits it gives true and on 10 digit getting false.
I am trying to validate the phone number, on onChangeText method, but whenever I typing a indian phone number +91 9867587654 When I reached to 11 digits it gives true and on 10 digit getting false.