Add cart functionality#2
Draft
mmena1 wants to merge 2 commits into
Draft
Conversation
mmena1
commented
Aug 1, 2023
Comment on lines
+22
to
+26
| {cartCtx.items.map(item => { | ||
| <ListItem disablePadding> | ||
| <ListItemText primary={item.name} /> | ||
| </ListItem> | ||
| })} |
Owner
Author
There was a problem hiding this comment.
For some reason, this doesn't work. But if I do cartCtx.items[0].name the name gets displayed. Why doesn't it work with map?
mmena1
commented
Aug 1, 2023
Comment on lines
+27
to
+32
| {/* <ListItem disablePadding> | ||
| <ListItemText primary="Hello" /> | ||
| </ListItem> | ||
| <ListItem disablePadding> | ||
| <ListItemText primary="World" /> | ||
| </ListItem> */} |
Owner
Author
There was a problem hiding this comment.
This, on the other hand, works as expected, so I'm not sure what's wrong with cartCtx.items.map
mmena1
commented
Aug 1, 2023
Comment on lines
+39
to
+40
| {cartItems} | ||
| {/* {cartCtx.items[0].name} */} |
Owner
Author
There was a problem hiding this comment.
If I comment the first line and uncomment the second one, {cartCtx.items[0].name} works fine.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.