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

104
Views
Forma correcta de llamar a la función onChange en React Final Form

De acuerdo con la documentación de React Final Form, puedo pasar la devolución de llamada onChange al componente <FormSpy /> para ejecutar el código cuando cambia el estado del formulario. Sin embargo, también descubrí que si necesito ejecutar alguna función cada vez que cambia el formulario, también puedo poner esta función dentro de la devolución de llamada del formulario antes de la declaración de devolución:

 <Form onSubmit={onSubmit} render={({ handleSubmit }) => { myFunctionToRunOnChange(); // Call function here return ( <form onSubmit={handleSubmit}> <div> <label>First Name</label> <Field name="firstName" component="input" placeholder="First Name" /> </div> <button type="submit">Submit</button> </form> ); }} />

¿Es una buena práctica? Por ejemplo, comparando con el uso de FormSpy para onChange...

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!