Created
October 26, 2020 07:09
-
-
Save Tunji545/82442d5d9f6d67160e27b081446cde5a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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