const phoneRegExp = /^((+[1-9]{1,4}[ -]*)|(([0-9]{2,3})[ -]*)|([0-9]{2,4})[ -]*)*?[0-9]{3,4}?[ -]*[0-9]{3,4}?$/
phoneNumber: Yup.string().matches(phoneRegExp, 'Phone number is not valid')
// See https://repl.it/repls/PartialAlicebluePrediction
import * as yup from 'yup';
// const yup = require("yup");
import "yup-phone";
// require("yup-phone");
// validate phone number strictly in the given region
const phoneSchema = yup.string()
.phone("IN", true)
.required();
console.log(phoneSchema.isValidSync("+919876543210")); // → true