Created
June 20, 2018 04:41
-
-
Save bmorelli25/758332eec2f50f61a26ab9fa0fa798a9 to your computer and use it in GitHub Desktop.
comment-list.js
Raw
comment-list.js
This file contains hidden or 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
Show hidden characters
| // src/components/comment-list.js | |
| import React from 'react' | |
| export default ({comments}) => { | |
| comments = comments.map((comment, i) => ( | |
| <div key={i} style={{ | |
| padding: '5px', | |
| border: '1px solid grey' | |
| }}> | |
| <p><strong>{comment.author}:</strong></p> | |
| <p>{comment.message}</p> | |
| </div> | |
| )) | |
| return ( | |
| <section> | |
| <strong>Comments: </strong>{comments} | |
| </section> | |
| ) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment