-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
render list items on List component #15
Conversation
Visit the preview URL for this PR (updated for commit e203c48): https://tcl-57-smart-shopping-list--pr15-ap-jg-render-list-it-hvlk1cdc.web.app (expires Tue, 11 Apr 2023 22:09:16 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: ad3eb6c34c2ec5986fcc218178df5985eb9c9ffb |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great. The map function is successfully rendering each list item name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of the links. No issues with the code. Great work!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work @Amy-Pr and @jongranados. Looks very clean.
data.map((item) => ( | ||
<ListItem name={item.name} key={item.id} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good! You can also choose to destructure the item object to pass the attributes without dot notation, if you wish.
{data.map(({ name, id }) => ( <ListItem key={id} name={name} /> ))}
Description
This code renders data fetched from the backend on the List component. We created a map function to map over each element in the data array and create a ListItem component to display for each element.
Learning: We reviewed how to use Chrome React tools to look at the shape of the props being passed.
Related Issue
closes #1
Acceptance Criteria
Type of Changes
Updates
Before
After
Testing Steps / QA Criteria