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

103
Views
Submit button not giving required result

My submit button is not displaying output when i am pressing it but when i do a backspace it is giving me the output on the screen. enter image description here

about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

Post code instead of posting images

According to the image that you have provided, inside saveTask you are pushing the obj to the taskList and then passing it to the state updating function. Arrays are of reference type and since here you are not passing a new array, react will figure out that the array hasn't changed (although you have appended the obj) and hence it won't trigger a re-render.

So change your code to this,

const saveTask = (taskObj) => {
      setTaskList(prevList => {
           prevList.push(taskObj) 
           return [...prevList]      
      })
}
about 4 years ago · Santiago Gelvez 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!