const { selectedButton } = this.state;
var boundingBoxCollection = [];
console.log(boundingBoxCollection.length);
var boundingBoxes = document.querySelectorAll('.cropper-face');
console.log("I am ice"+boundingBoxes.length);
if(boundingBoxes.length > 0){
boundingBoxes.forEach(elem => {
if(!boundingBoxCollection.includes(elem)){
boundingBoxCollection.push(elem);
}
});
}
my boundingBoxCollection is not updated
fix this, I want my array to be updated
2
Answers