Skip to content

Commit 8a7cb54

Browse files
authored
Merge pull request #189 from exentrich/patch-1
2 parents 335bb96 + 17878f7 commit 8a7cb54

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/react-sortable.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,9 @@ Please read the updated README.md at https://github.com/SortableJS/react-sortabl
115115
const dataid = dataIdAttr || "data-id";
116116
/* eslint-disable-next-line */
117117
return Children.map(children as ReactElement<any>[], (child, index) => {
118-
const item = list[index];
118+
if (child === undefined) return undefined
119+
120+
const item = list[index] || {};
119121
const { className: prevClassName } = child.props;
120122

121123
// @todo - handle the function if avalable. I don't think anyone will be doing this soon.

0 commit comments

Comments
 (0)