You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Deferred queries are not automatically passed to the output of the loader, you have to use the `transform` argument (and it's second argument) to expose the queries for the consumers. The format of how you transform it is not important, but it is the only way to _get_ the deferred query result out of the loader.
It's worth mentioning that queries and transform are linked in this context, meaning that if you supply a new queries argument in the extended loader, but no transform, then you will not inherit the transform from the original loader.
20
20
21
-
- Supplying just a new `queries` argument will result in transform being undefined in practise.
21
+
- Supplying just a new `useQueries` argument will result in transform being undefined in practise.
22
22
- Supplying just a new `transform` argument will result in the new transform being ignored.
23
-
- Supplying a new `transform` and a new `queries` argument will properly overwrite the existing base properties.
23
+
- Supplying a new `transform` and a new `useQueries` argument will properly overwrite the existing base properties.
24
24
25
25
All other properties in the loader will overwrite as expected. You can, for example, just supply a new `onLoading`, or `onError`.
26
26
27
+
`.extend` will not merge two separate `useQueries` properties. For example, you cannot _just_ inherit the deferredQueries, you must either inherit all or none of the `useQueries` argument.
28
+
27
29
:::info
28
30
You may extend _extended_ loaders, to create an inheritance model.
Copy file name to clipboardExpand all lines: docs/docs/Quick Guide/add-queries.md
+27-12Lines changed: 27 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,36 +6,46 @@ sidebar_position: 3
6
6
7
7
You can now start to add queries to your extended loaders.
8
8
9
-
The `queries` argument of [createLoader](/Exports/create-loader) is a _hook_, which means that [the rules of hooks](https://reactjs.org/docs/hooks-rules.html) apply. This gives you the super-power of utilizing other hooks inside of your loader.
9
+
The `useQueries` argument of [createLoader](/Exports/create-loader) is a _hook_, which means that [the rules of hooks](https://reactjs.org/docs/hooks-rules.html) apply. This gives you the super-power of utilizing other hooks inside of your loader.
0 commit comments