@steroidsjs/core 3.0.11 → 3.0.12
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.
- package/hooks/useTree.js +4 -1
- package/package.json +1 -1
package/hooks/useTree.js
CHANGED
|
@@ -124,7 +124,10 @@ function useTree(config) {
|
|
|
124
124
|
var selectedItem = findChildById(items, selectedItemId, primaryKey);
|
|
125
125
|
setSelectedUniqueId(selectedItem ? selectedItem.uniqueId : null);
|
|
126
126
|
}, [items]);
|
|
127
|
-
var localTree =
|
|
127
|
+
var localTree = (0, react_1.useMemo)(function () {
|
|
128
|
+
var rawLocalTree = clientStorage.get(CLIENT_STORAGE_KEY);
|
|
129
|
+
return rawLocalTree ? JSON.parse(rawLocalTree) : {};
|
|
130
|
+
}, [clientStorage]);
|
|
128
131
|
var saveInClientStorage = function () {
|
|
129
132
|
if (config.saveInClientStorage) {
|
|
130
133
|
localTree[config.clientStorageId] = expandedItems;
|