catamphetamine / react-phone-number-input

React component for international phone number input

Home Page:http://catamphetamine.gitlab.io/react-phone-number-input/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

React-phone input error in formik while using handlechange

Rahulr2001 opened this issue · comments

class Createemp extends Component{

render(){
return(



{

  ({ handleSubmit, handleChange, values, errors }) =>
   (
  <form className="container" onSubmit={handleSubmit}>
    <div >
    


      <PhoneInput
      name='phone'
      country={'us'}
      value={values.phone}
      onChange={handleChange}
     />
      <small  >{errors.phone}</small>

      
    </div>
    <button
    type='submit'
    className="empcreate"
      //onClick={this.createRestaurant}
      //onClick={window.location.reload()}
    ><span className="text">Create</span></button>
  </form>
      
)}
</Formik>
    </div>
)

}

}

export default Createemp;

...value which i enter in the input is always empty..even i entered a mobile...the on change event didnt work for me to give the value to values.phone for my validation

sir..how i change it to event in code.. iam stuck here...i have read all your comment in previous issues but..stuck on the code..that where to change...which code to add.. can u demonstrate me sir