Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

119
Views
Obtener una matriz de objetos al cambiar de país en react-native-phone-number-input

Estoy usando react-native-phone-number-input en mi proyecto. También estoy usando formik dentro de él.

A continuación se muestra mi código:

 const textChangeHandler = (text: any) => { var getCode = phoneInput.current?.getCallingCode(); var getText = '+' + getCode + text; form.setFieldTouched(field.name); form.setFieldValue(field.name, getText); console.log('>>', getText); if (onUpdate) { onUpdate(getText); } }; <PhoneInput ref={phoneInput} defaultValue={''} defaultCode="US" layout="first" onChangeCountry={value => { textChangeHandler(value); }} onChangeText={textChangeHandler} autoFocus />

Tengo que pasar el número escrito con código de país en form.setFieldValue . Funciona bien si selecciono el país primero y luego escribo mi número, si hago esto, >> +11234567890 en la consola. Pero si escribo el número primero y luego selecciono el país, obtengo >> +1[object Object] .

No soy capaz de averiguar dónde estoy cometiendo un error.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!