Skip to content

How to work with identical, deeply nested data?

For example, has the following data: And for example an array with indexes leading to the required element(but can be any other): How can you work with an element having this data? For example, need to change “value” in the element at the specified path in “ids”. Answer You could take …

reactjs context reducer increment data

How to increment the array value inside the object. I tried the code below but It’s removing the garments array and replacing it with shirts: Nan value Answer You’re trying to spread the properties of your garments array into your new booking object, however, as state doesn’t have a garments…