Skip to content

Conversation

@siddharthkp
Copy link
Member

ipc103 and others added 3 commits February 28, 2024 18:54
Towards #4315

The SelectPanel only did a basic equality check for the item state, meaning
that it depended on having the exact same objects on multiple pass throughs.

This isn't always possible as sometimes you may want to have different objects.

This replaces the equality check with a test for an `id` property on the object.

If the `id` property isn't present, we fallback to the old behavior.

Note that a previous version used the `key` prop, but we decided `id` was a
better interface. ipc103@f472da2#r139163795
Co-authored-by: Andrew Henry <[email protected]>
Towards #4315

The SelectPanel only did a basic equality check for the item state, meaning
that it depended on having the exact same objects on multiple pass throughs.

This isn't always possible as sometimes you may want to have different objects.

This replaces the equality check with a test for an `id` property on the object.

If the `id` property isn't present, we fallback to the old behavior.

Note that a previous version used the `key` prop, but we decided `id` was a
better interface. ipc103@f472da2#r139163795
Co-authored-by: Andrew Henry <[email protected]>
@changeset-bot
Copy link

changeset-bot bot commented Feb 29, 2024

🦋 Changeset detected

Latest commit: f916ed6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 113.57 KB (+0.04% 🔺)
packages/react/dist/browser.umd.js 114.24 KB (+0.04% 🔺)

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