We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0af7de9 commit 559f8ffCopy full SHA for 559f8ff
examples/04 Sortable/Simple/Card.js
@@ -58,7 +58,10 @@ const cardTarget = {
58
// Time to actually perform the action
59
props.moveCard(dragIndex, hoverIndex);
60
61
- // Update the monitors item with the new index
+ // Note: we're mutating the monitor item here!
62
+ // Generally it's better to avoid mutations,
63
+ // but it's good here for the sake of performance
64
+ // to avoid expensive index searches.
65
monitor.getItem().index = hoverIndex;
66
}
67
};
0 commit comments