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

99
Views
Slice and Update are not taking place at the same time

I have mo state array that gets its value from the rest api get request. Those values are visualized in a table that has option to delete the particular mo object by considering the name of the mo.

The below added logic is to slice the mo object from the table and in the backend as well. And the UpdateMO will update the new mo which populates the current mo objects.

While I do this, the value gets deleted but the table row is not removed. Empty row is still present. Next Time I delete again the row gets deleted. How to splice and update the mo at the same time

for(var index = 0;index < mo.length; index++){
    if(index !== -1 && mo[index]['name'] === name){
      mo.splice(index, 1);
      UpdateMO((mo) => [...mo, mo]);
    }

  }
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!