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

151
Views
How can I get an empty field when I click on the append using the useFieldArray of React-hook-form?

Whenever I click on the append button, the generated field value printed as a [object object] but I want to get a blank field. I want to output like this : "fieldName" : ["value1","value2"...n]. In this code, I get the output as I like, but every time I have to remove the [object obejct] that is printed in the appended field. Example Image:

code link : https://codesandbox.io/s/practical-star-jif19c?file=/src/index.js:162-177

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Since your array contains only origin names and not objects of origin you should put "" inside append function not {} object.

<Button
    variant="contained"
    component="label"
    type="button"
    onClick={() => append('')}
>
    Add Items
</Button>
about 4 years ago · Juan Pablo Isaza Report
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!