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

177
Vistas
Can I use uncontrolled inputs in React without ref?

I've a complex form (with over than 70 inputs) and it has many different inputs and children forms... I've decided to add a from tag then repeat all inputs inside that:

<form>
  <input name="email" />
  <input name="age" />
  <input name="address" />
  .
  .
  .
  { loop on state (Array) to render other re-usable form component for category or city etc. }
  { another loop on state (Array) to render file inputs and checkboxes etc. }
  .
  .
  .
</form>

I actually should get an API data then generate that form to collect data from user (we haven't a fixed and common form, it depends on client and many things...). After that, I decided to forget controlled inputs, because I've to make a spaghetti and complex component to handle many states for this situation, I decided to use something like Formik, but that's not really easy! because I've to pass many API methods to handle custom inputs onChange values...

Therefore, I've decided to get form values by onSubmit event (without ref):

const handleSubmit = (e) => {
  e.preventDefault();
  const values = new FormData(e.target);
  sendForm(values); // sending form by post method and formData
}

<form onSubmit={handleSubmit}>
.
.
.
</form>

But I've an important question, does effect uncontrolled input on React performance? or it's not best practice and I've to find a solution to implement form by controlled inputs?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

No. There is no issue using uncontrolled input on React performance.You should use controlled input when you need realtime validation or checking input state on change.But if you don't need any real time check then using FormData is good practie.

about 4 years ago · Juan Pablo Isaza Denunciar
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