this is what my JSON response looks like. I could get the values of id and title etc but not actor since actor is another array inside the json object. below is what my react code looks like. I tried several options but always end up with error of undefined property.
```
{
actor: [
{
name: "Leonardo DiCaprio"
},
{
name: "Kate Winslet"
}
],
_id: "5e973eef8af37634940e9a5b",
title: "Titanic",
director: "James Cameron",
genre: "Romantic",
imageURL: "https://www.google.com/url?sa=i&url=https%3A%2F%2Fencrypted-tbn0.gstatic.com%2Fimages%3Fq%3Dtbn%3AANd9GcQhYjUIu2o5v5u3rfJpCq5Cz0Q9WK--XdYxai_N2d0ImohPiIOp&psig=AOvVaw1SjoYtMGvlUsg-hW-iHO8c&ust=1588932208988000&source=images&cd=vfe&ved=0CA0QjhxqFwoTCMjSivG_oekCFQAAAAAdAAAAABAD",
__v: 0
}
```
My React code looks like this.
```
class MovieDetails extends Component
{
constructor(props) {
super(props);
this.state = {
movie: [],
isLoaded: false,
}
}
componentWillMount() {
let id = this.props.id;
fetch(`http://localhost:5000/movie/details/${id}`)
.then(res => {
return res.json();})
.then(movie => {
this.setState({ movie });
})
.catch(console.log('error'));
}
render() {
return (
<div className="container">
<div className ="centre">
<div className="col-xs-12">
{this.state.movie.map((movie => (
<div class="container" >
<div>
<h3>{movie.title}</h3>
<img src={movie.imageURL} className="img-responsive" height = "120" width ="120"/>
<h5 className="card-genre" >Genre : {movie.genre}</h5>
<h5 className="card-director">Directed by : {movie.director}</h5>
</div>
</div>
)
))}
</div>
</div>
</div>
);
}
}
export default MovieDetails;
```