Skip to content

Commit

Permalink
Pass index to createItem()
Browse files Browse the repository at this point in the history
  • Loading branch information
Jas Chen committed May 24, 2016
1 parent 299f6cb commit c87a388
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class DndCard extends Component {
...restProps
} = this.props;

const item = createItem(source, isDragging);
const item = createItem(source, isDragging, index);
if (typeof item === 'undefined') {
console.warn('Warning: createItem returns undefined. It should return a React component or null.');
}
Expand All @@ -89,7 +89,7 @@ class DndCard extends Component {

return connectDragSource(connectDropTarget(
<div {...finalProps}>
{createItem(source, isDragging)}
{item}
</div>
));
}
Expand Down

0 comments on commit c87a388

Please sign in to comment.