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
You can add as many queries as you'd like to `Response.queries`, and they will all aggregate to a common loading state.
32
-
33
-
## Accepting arguments
34
-
35
-
If you want the loader to take an argument, you can do that.
36
-
37
-
```tsx {2}
38
-
exportconst userRouteLoader =baseLoader.extend({
39
-
useQueries: (userId:string) => {
40
-
const user =useGetUserQuery(userId);
41
-
const posts =useGetPostsByUser(userId);
42
-
43
-
return {
44
-
queries: {
45
-
user,
46
-
posts,
47
-
},
48
-
};
49
-
},
50
-
});
51
-
```
52
-
53
-
:::caution Beware
54
-
If you want to consume this loader through `withLoader`, you need to add the `queriesArg` argument. This supplies the loader with an argument piped from `props`.
55
-
:::
56
-
57
-
### `queriesArg`
58
-
59
-
This argument transforms the consumer's props to the queries argument.
60
-
61
-
```tsx {1-5,8-10}
62
-
// This means that any component that has props that extend this
0 commit comments