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

112
Views
Reset individual form input without re-rendering entire app in React?

My app gets initialized with a json payload of 'original values' for attributes in a task form. There is a shared state submissionState between various components in the app as children of a context provider which is a copy of the original values json but includes any edits made to attributes in the form. I would like to include individual 'reset' buttons for each input of the form which would update submissionState by setting the value for that input field to the original value in the json payload.

Code here: https://codesandbox.io/s/infallible-smoke-wtom9m

However, whenever I implement a reset button on a form input the entire app resets, even if I use e.preventDefault. Am I calling prevent default wrong and I just cant see the console error because the app is reseting?

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!