Skip to content

Instantly share code, notes, and snippets.

@Tunji545
Created October 26, 2020 07:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tunji545/82442d5d9f6d67160e27b081446cde5a to your computer and use it in GitHub Desktop.
Save Tunji545/82442d5d9f6d67160e27b081446cde5a to your computer and use it in GitHub Desktop.
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