JakeSidSmith / react-reorder

Drag & drop, touch enabled, reorderable / sortable list, React component
https://jakesidsmith.github.io/react-reorder/
MIT License
218 stars 58 forks source link

Use iterator for `itemKey` #72

Open seansean11 opened 7 years ago

seansean11 commented 7 years ago

I'm working on a list of todos that are stored in localStorage as an array of objects. Instead of having to try to create a unique itemKey property on each of the todo objects, I'd like to leverage the iterator of my Reorder list. Is this possible?

JakeSidSmith commented 7 years ago

I had fixed this in another experimental branch whereby you could pass a function as the itemKey (which you could then use to return a suitable key), but this has since become unnecessary due to a re-write I'm working on: #71

JakeSidSmith commented 7 years ago

Update: just released 3.0.0-alpha.0 on npm. I'd suggest checking out this version, it should be far more stable than the existing release, fixes a lot of bugs, and adds the ability to drag between lists. :)

See the readme after installation, there's been a considerable change to the interface.