score:0

i think you can remove this line

useeffect(() => {
        setformdata({

            checkbox1:checkbox})
        
    }, [])

because it is calling setformdata again even though it's been changed in onchange function.

score:0

seemingly you are trying to spread array in a wrong way:

try to replace this:

tasks: {task,_id,date,checkbox}

with

tasks: [{ task, _id, date, checkbox }, { task: task2, _id: _id2, date: date2, checkbox: checkbox1 }]

Related Query

More Query from same tag