We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9ff08d1 commit dac850dCopy full SHA for dac850d
lib/component/Tree.js
@@ -31,13 +31,10 @@ var walkable = {
31
}));
32
33
if (children.length) {
34
- var initialValue = {};
35
- initialValue[walkable.childrenName] = [];
36
var grandChildren = children.reduce(function (a, b) {
37
- var subAChildren = a[walkable.childrenName];
38
var subBChildren = b[walkable.childrenName];
39
- return subAChildren.concat(subBChildren);
40
- }, initialValue);
+ return a.concat(subBChildren);
+ }, []);
41
42
if (grandChildren.length) {
43
iterate(grandChildren);
0 commit comments