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

626
Vistas
useState and onChange with React Quill not working as I want it to, not sure how to fix

I have a series of text input fields - their input is managed by useState like this:

const [formFields, setFormFields] = useState([
{ textinput1: "", textinput2: "", textinput3: "", reactQuill: "" } ]);

Their handle change is managed with this function, because more text fields can be added, and every index of the additions has to have its input get saved:

function handleChangeInput(index, event) {
    const values = [...formFields];
    values[index][event.target.name] = event.target.value
    setFormFields(values);
}

And this is what they look like and function as intended:

{
      formFields.map((formField, index) => (

      <React.Fragement key={index}>

      <TextField

      name='textinput1'
      value={formField.textinput1}
      onChange={event => handleChangeInput(index, event)}
      
      />
      ))
      }

However, when I try the same exact logic with the React Quill (rich text editor) input, it's not working at all. So for example, this will not work:

 <ReactQuill 
    
    name="reactQuill"
    onChange={event => handleChangeInput(index, event)}
    value={formField.reactQuill}
    

    />

I am getting an error of "name" being undefined, and I am not sure how to work around this? Thanks in advance if anyone knows how to fix 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