Skip to content
Advertisement

How to concat the object is useState array?

I have the useState varible. I want to concat the value with new object.

JavaScript

rules: 1.If the date exist with isSelected flag then make as false

JavaScript

otherwise, make as,

JavaScript

my function below,

JavaScript

expected output

JavaScript

but I got this,

JavaScript

Advertisement

Answer

Replace your map code with this

JavaScript

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement