Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Error 1:
TypeError: Cannot read property 'map' of undefined
DishDetail.render
C:/test/Coursera/React/confusion/src/components/DishdetailComponent.js:26
23 | </Card>
24 | </div>
25 | <div className="col-12 col-md-5 m-1">
> 26 | <h4>Comments</h4>
| ^ 27 | {
28 | this.props.comments.map(comment => (
29 | <ul className="list-unstyled">
Error 2:
TypeError: Cannot read property 'id' of undefined
DishDetail.render
C:/test/Coursera/React/confusion/src/components/DishdetailComponent.js:17
14 | return(
15 | <div className="row">
16 | <div className="col-12 col-md-5 m-1">
> 17 | <Card key={this.props.dish.id}>
| ^ 18 | <CardImg top src={this.props.dish.image} alt={this.props.dish.name} />
19 | <CardBody>
20 | <CardTitle>{this.props.dish.name}</CardTitle>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment