Skip to content

Commit

Permalink
fix: fixed duplication for single chlid
Browse files Browse the repository at this point in the history
  • Loading branch information
md-rehman committed Dec 3, 2021
1 parent b3553df commit 3fd6974
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/utils/getAttachedChildren.ts
Expand Up @@ -6,6 +6,10 @@ export default (children: any) => {
| Separate the trailing (not first) children from the children array
*/

if (childrenArray.length <= 1) {
return childrenArray;
}

const trailingChildren = childrenArray.slice(1);
trailingChildren.pop();
const marginProp: object = {
Expand Down

0 comments on commit 3fd6974

Please sign in to comment.