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

625
Views
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
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!