demonz's avatar

update state on index problem

hello can you help me rewrite this code in the correct form because it gives error

<select name="Attendance_status" onChange={(e,index) => setData('Attendance_status', [...data.Attendance_status,data.Attendance_status[index]:e.target.value])}>
0 likes
1 reply
MohamedTammam's avatar

The error is here, what are you trying to do with this part?

data.Attendance_status[index]:e.target.value

Please or to participate in this conversation.