@omnigrid/react 0.1.15 → 0.1.16
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/dist/useGrid.js +7 -7
- package/package.json +1 -1
package/dist/useGrid.js
CHANGED
|
@@ -72,17 +72,17 @@ export function useGrid(options) {
|
|
|
72
72
|
grid.setColumns(options.columns);
|
|
73
73
|
}
|
|
74
74
|
}, [grid, options.columns]);
|
|
75
|
-
// Sync loading state.
|
|
76
|
-
//
|
|
77
|
-
|
|
75
|
+
// Sync loading state. An explicit boolean prop always wins and is applied
|
|
76
|
+
// on every change (including the first flush — the Grid constructor may
|
|
77
|
+
// have been created with a stale value). `undefined` means the host does
|
|
78
|
+
// not manage loading: the core or a plugin (e.g. InfiniteScrollPlugin
|
|
79
|
+
// during its initial fetch in register()) may own the state, and the prop
|
|
80
|
+
// must not stomp it with a forced `false`.
|
|
78
81
|
useEffect(() => {
|
|
79
82
|
if (grid.isDestroyed())
|
|
80
83
|
return;
|
|
81
|
-
if (
|
|
82
|
-
loadingSyncedRef.current = true;
|
|
83
|
-
grid.setLoading(!!options.loading);
|
|
84
|
+
if (options.loading === undefined)
|
|
84
85
|
return;
|
|
85
|
-
}
|
|
86
86
|
grid.setLoading(!!options.loading);
|
|
87
87
|
}, [grid, options.loading]);
|
|
88
88
|
return {
|