I've got a problem again with changing a property on an object inside an array, but this time its an array in an array in an array ...
I've got a problem on changing the preview of the picture.
this has no effect:
return {
...picture,
preview: "hallo"
}
The full code is:
this.setState((prevState) => ({
stepsData: prevState.stepsData.map(step => {
if (step.identifier === stepIdentifier) {
console.log("lkkljk",step)
step.onChangeContentComponents.map(
contentComponent => {
if (contentComponent.pictures !== null){
console.log(contentComponent.pictures);
console.log(contentComponent.pictures[0].preview);
contentComponent.pictures.map(picture => {
return {
...picture,
preview: "hallo"
}
});
}
return contentComponent
}
);
return {
...step,
[targetArray]: newArray,
}
}
return step
})
}), () => {
console.log(this.state.stepsData)
});
thanks.