What's wrong with below code?
this.setState({
album: {
...this.state.album,
photos: [
...this.state.album.photos,
{ url : newUrl }
]
}
})
It worked if photos have something, but if album is an empty object, I will got this error
Cannot convert undefined or null to object