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

196
Views
React js: cómo restablecer la entrada de react-phone-input-2 después de cambiar el código de país

entonces necesito restablecer el valor de entrada después de cambiar el país pero mantiene el mismo valor, estoy usando componentes funcionales de reacción y estoy atascado en este punto

este es mi código a continuación

 <PhoneInput country={ip.toLocaleLowerCase()} value={phone} countryCodeEditable={false} specialLabel={""} enableSearch={true} masks={phoneFormat} searchPlaceholder={""} placeholder={t("register:phone")} inputStyle={{ paddingTop: 26, paddingRight: 14, paddingBottom: 26, paddingLeft: 58, width: "100%", zIndex: 1, backgroundColor: "#F3F6F9", border: "none", }} onChange={(e) => { setPhone(e); setErrors({ ...errors, phone: false }); }}

Gracias por responder

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

¿Está almacenada la ip en el estado en alguna parte? Es posible que tenga una const [ip, setip] = useState() en algún lugar, y luego configure ip en el controlador de cambios anterior para:

 onChange={(e) => { setPhone(e); setErrors({ ...errors, phone: false }); setIp(e.target.value) }}
about 4 years ago · Juan Pablo Isaza Report
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!