Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

157
Vistas
React Otp Input onChange not getting called on entering input

I am using react-otp-input, in a preact application. I have written the following code ,

const [otp, setOtp] = useState('');
<OtpInput
  value={otp}
  onChange={(value) => {
      console.log(value);
      setOtp(value);
  }}
  placeholder={'12121'}
  numInputs={5}
  containerStyle={'otp-container'}
  inputStyle={'otp-input'}
  errorStyle={'otp-error'}
  hasErrored={otpError}
  />

When I am input any value from keyboard the otp is not getting updated i.e onChange is not getting called, but when I hit backspace, the onChange is getting called.

Please help me to resolve this.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda