Skip to content

Commit 3fd6974

Browse files
committed
fix: fixed duplication for single chlid
1 parent b3553df commit 3fd6974

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/utils/getAttachedChildren.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ export default (children: any) => {
66
| Separate the trailing (not first) children from the children array
77
*/
88

9+
if (childrenArray.length <= 1) {
10+
return childrenArray;
11+
}
12+
913
const trailingChildren = childrenArray.slice(1);
1014
trailingChildren.pop();
1115
const marginProp: object = {

0 commit comments

Comments
 (0)