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

fix: render Slices in the correct order in <SliceZone> #104

Merged
merged 1 commit into from
Nov 22, 2021

Conversation

angeloashmore
Copy link
Member

@angeloashmore angeloashmore commented Nov 22, 2021

Types of changes

  • Chore (a non-breaking change which is related to package maintenance)
  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

Related issue: #101

This PR fixes an issue where Slices could render in the wrong order in <SliceZone>.

The bug only occurs when the list of Slices changes after the first render. The bug occurs because the key prop is generated using the Slice's object. If multiple Slices contain the same payload (e.g. same Slice type, content, etc.), they would have duplicate keys.

To reduce the possibility of key collisions, this PR appends the Slice's index to the key.

Checklist:

  • My change requires an update to the official documentation.
  • All TSDoc comments are up-to-date and new ones have been added where necessary.
  • All new and existing tests are passing.

🔑

@angeloashmore angeloashmore merged commit ffc4d4a into v2 Nov 22, 2021
@angeloashmore angeloashmore deleted the aa/fix-slicezone-ordering branch November 22, 2021 23:59
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.

1 participant