Skip to content
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

Add more keys and unique key props #43

Merged
merged 3 commits into from
Sep 30, 2024
Merged

Add more keys and unique key props #43

merged 3 commits into from
Sep 30, 2024

Conversation

sar-mko
Copy link
Collaborator

@sar-mko sar-mko commented Sep 30, 2024

Description

  • One of the problems was that list.id and item.id either didn't exist or were identical to item name (so not unique enough)
  • Another was that the properties on filteredObject were mapped through and no assigned keys.
  • Used crypto.randomUUID() in the rendering in Home.js , and added a Fragment in List.jsx to add the key to the outside mapping.

Related Issue

closes issue #32

Acceptance Criteria

  • The key prop is added to the appropriate list element
  • The console is clear of any errors

Type of Changes

bug fix

Updates

  • Used crypto.randomUUID() for all keys
  • Added a new key for the outer map on filteredObject in List.jsx

Testing Steps / QA Criteria

  • Click through your lists and view both the Home page and List Page
  • There should be no errors in the console for invalid Key not being unique.

Copy link

Visit the preview URL for this PR (updated for commit a2835ba):

https://tcl-76-smart-shopping-list--pr43-sm-fix-key-bug-8kj71g3d.web.app

(expires Mon, 07 Oct 2024 03:29:53 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 512b1a88be8ae05fd3e727b99332819df760271d

Copy link
Collaborator

@arandel1 arandel1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job, Sarah! Thanks for taking care of that bug. Everything looks good on my end.

Copy link
Collaborator

@EmmaBin EmmaBin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice Job, thanks for figuring this out by implementing crypto.randomUUID().

@sar-mko sar-mko merged commit fed03fa into main Sep 30, 2024
2 checks passed
@sar-mko sar-mko deleted the sm-fix-key-bug branch October 4, 2024 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants