Skip to content

Update drag-and-drop rx.foreach example to use key prop#6638

Open
masenf wants to merge 1 commit into
mainfrom
masenf/enterprise-docs-dnd
Open

Update drag-and-drop rx.foreach example to use key prop#6638
masenf wants to merge 1 commit into
mainfrom
masenf/enterprise-docs-dnd

Conversation

@masenf

@masenf masenf commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@masenf masenf requested review from a team and Alek99 as code owners June 9, 2026 21:44
@greptile-apps

greptile-apps Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR improves the drag-and-drop documentation by clarifying why key props matter in rx.foreach and updating the example accordingly.

  • Adds a brief explanation that a stable item identifier should be passed as the key prop to the outermost component rendered by rx.foreach, so React can track item identity during list reordering.
  • Updates the droppable_list example to call draggable_list_item(item=item, key=item.id) instead of draggable_list_item(item=item), aligning the demo code with the new guidance.

Confidence Score: 5/5

Documentation-only change; no runtime code is modified.

The change adds a short paragraph of guidance and threads key=item.id into the memoized component call, which is the correct pattern for stable list rendering in Reflex. The updated example matches the new prose, and the ListItem.id field already exists in the dataclass, so the key expression is valid. No logic, APIs, or side effects are touched.

No files require special attention.

Important Files Changed

Filename Overview
docs/enterprise/drag-and-drop.md Adds explanatory prose about the key prop requirement for rx.foreach and updates the draggable list example to pass key=item.id to the memoized component.

Reviews (1): Last reviewed commit: "Update drag-and-drop rx.foreach example ..." | Re-trigger Greptile

@codspeed-hq

codspeed-hq Bot commented Jun 9, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 26 untouched benchmarks
⏩ 8 skipped benchmarks1


Comparing masenf/enterprise-docs-dnd (7c3a8c3) with main (f232cf4)

Open in CodSpeed

Footnotes

  1. 8 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

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