@sheinx/hooks 3.9.7-beta.5 → 3.9.7-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -305,7 +305,7 @@ var useTree = function useTree(props) {
|
|
|
305
305
|
var indexPath = [].concat(_toConsumableArray(index), [i]);
|
|
306
306
|
ids.push(id);
|
|
307
307
|
var children = [];
|
|
308
|
-
if (Array.isArray(item[childrenKey])) {
|
|
308
|
+
if (item && Array.isArray(item[childrenKey])) {
|
|
309
309
|
var _children = initData(item[childrenKey], [].concat(_toConsumableArray(path), [id]), mode === MODE.MODE_4 ? disabled : _isDisabled, indexPath, level + 1, id);
|
|
310
310
|
if (_children) children = _children;
|
|
311
311
|
}
|
|
@@ -341,7 +341,7 @@ var useTree = function useTree(props) {
|
|
|
341
341
|
result.push(node);
|
|
342
342
|
}
|
|
343
343
|
}
|
|
344
|
-
if (Array.isArray(item[childrenKey])) {
|
|
344
|
+
if (item && Array.isArray(item[childrenKey])) {
|
|
345
345
|
initFlatData(item[childrenKey], [].concat(_toConsumableArray(path), [id]), level + 1, id, result);
|
|
346
346
|
}
|
|
347
347
|
}
|
|
@@ -298,7 +298,7 @@ var useTree = function useTree(props) {
|
|
|
298
298
|
var indexPath = [].concat(_toConsumableArray(index), [i]);
|
|
299
299
|
ids.push(id);
|
|
300
300
|
var children = [];
|
|
301
|
-
if (Array.isArray(item[childrenKey])) {
|
|
301
|
+
if (item && Array.isArray(item[childrenKey])) {
|
|
302
302
|
var _children = initData(item[childrenKey], [].concat(_toConsumableArray(path), [id]), mode === MODE.MODE_4 ? disabled : _isDisabled, indexPath, level + 1, id);
|
|
303
303
|
if (_children) children = _children;
|
|
304
304
|
}
|
|
@@ -334,7 +334,7 @@ var useTree = function useTree(props) {
|
|
|
334
334
|
result.push(node);
|
|
335
335
|
}
|
|
336
336
|
}
|
|
337
|
-
if (Array.isArray(item[childrenKey])) {
|
|
337
|
+
if (item && Array.isArray(item[childrenKey])) {
|
|
338
338
|
initFlatData(item[childrenKey], [].concat(_toConsumableArray(path), [id]), level + 1, id, result);
|
|
339
339
|
}
|
|
340
340
|
}
|