floppy-disk 2.9.0-beta.2 → 2.9.0
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.
|
@@ -31,7 +31,7 @@ const useQueryDefaultDeps = (state) => [
|
|
|
31
31
|
state.isWaitingNextPage,
|
|
32
32
|
state.hasNextPage,
|
|
33
33
|
];
|
|
34
|
-
const
|
|
34
|
+
const fallbackComponent = () => null;
|
|
35
35
|
/**
|
|
36
36
|
* @see https://floppy-disk.vercel.app/docs/api#createquery
|
|
37
37
|
*/
|
|
@@ -408,7 +408,7 @@ export const createQuery = (queryFn, options = {}) => {
|
|
|
408
408
|
return state;
|
|
409
409
|
};
|
|
410
410
|
useQuery.Render = (props) => {
|
|
411
|
-
const { queryKey, loading =
|
|
411
|
+
const { queryKey, loading = fallbackComponent, success = fallbackComponent, error = fallbackComponent, } = props;
|
|
412
412
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
413
413
|
const state = useQuery(queryKey);
|
|
414
414
|
if (state.data)
|
|
@@ -34,7 +34,7 @@ const useQueryDefaultDeps = (state) => [
|
|
|
34
34
|
state.isWaitingNextPage,
|
|
35
35
|
state.hasNextPage,
|
|
36
36
|
];
|
|
37
|
-
const
|
|
37
|
+
const fallbackComponent = () => null;
|
|
38
38
|
/**
|
|
39
39
|
* @see https://floppy-disk.vercel.app/docs/api#createquery
|
|
40
40
|
*/
|
|
@@ -411,7 +411,7 @@ const createQuery = (queryFn, options = {}) => {
|
|
|
411
411
|
return state;
|
|
412
412
|
};
|
|
413
413
|
useQuery.Render = (props) => {
|
|
414
|
-
const { queryKey, loading =
|
|
414
|
+
const { queryKey, loading = fallbackComponent, success = fallbackComponent, error = fallbackComponent, } = props;
|
|
415
415
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
416
416
|
const state = useQuery(queryKey);
|
|
417
417
|
if (state.data)
|