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

106
Views
how to prevent list item change realtime with onchange method

I have a list that show some item, and they have Edit button beside the field, when you click the Edit button, it will show the modal that show name of the item where you can edit the name of the item. But the problem is when I try to change the name from the modal, the selected item from the list is changed too, before I click the save button.

Codesandbox

Thank you in advance.

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Don't change the parent state from the modal, create a local state in modal and pass it on to the parent in the onClose callback and then change the state in parent.

Demo: https://codesandbox.io/s/gifted-knuth-ik0ed

about 4 years ago · Santiago Trujillo 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!