I want to do a POST to an API endpoint, there's a field called space_photos, it accept array of objects.
this is my callback func whenever user uploaded a photo.
constructor(){
this.space_photo_holder = [];
}
callback = (e) => {
this.space_photos_holder.push(e);
this.setState({space_photos: this.space_photos_holder})
}
I think the code is legit but is there any better way to do it?