mgechev / mgechev/react-reorderable
Key generation
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 62
- Forks
- 16
- PR merge metrics
- No merged PRs in 30d
Description
The way the key for each item is being generated is not ideal as it uses the index of the item.
If you remove an item from the list, all the item DOM elements below that item in the list are removed and re-inserted as their index changes by -1 (not just re-rendered and compared against the virtual dom, they are actually removed and re-added (because of the key) which is a costly operation when you have a lot of elements).
The same is true if you re-order the source list, the component should be able to keep track of the objects between renders, regardless if one is removed or reordered in the source list.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the component's list-rendering and key-generation logic described in the issue. Check how removing and reordering source items affects existing DOM elements; done means items retain stable identity without unnecessary removal and reinsertion.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100