ems icon indicating copy to clipboard operation
ems copied to clipboard

1. task count not updating in Alltask UI. 2. Empty task object on first CreateTask.

Open sirajshaikh-dev opened this issue 1 year ago • 0 comments

Key Improvements for the Update:

  1. Immutability Fix: The original code directly modifies userData by using elem.tasks.push() and updating elem.taskCounts in the loop. This breaks React’s immutability principles. Updated logic will create new references for tasks and taskCounts.
  2. State Simplification: Instead of managing a newTask object separately, directly construct the task inside the loop for better readability.

sirajshaikh-dev avatar Dec 22 '24 14:12 sirajshaikh-dev