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
> If the loader you extend has a `transform` function, and you are changing the `queries` function, you might need to do this to resolve the types properly:
208
223
209
224
```typescript
210
-
createLoader({
211
-
queries: () => {
212
-
return [useGetUser(), useGetPosts()] asconst;
213
-
},
214
-
transform: function (queries) {
215
-
// queries here are guaranteed to have .data, but currently the type resolves data as optional.
216
-
return {
217
-
name: queries[0].data.name, // is technically safe, but typescript might complain
218
-
};
219
-
},
225
+
const baseLoader =createLoader({
226
+
queries: () => [...],
227
+
transform: () => {i_want: "this-format"},
228
+
})
229
+
230
+
const pokemonLoader =baseLoader.extend({
231
+
queries: () => [...],
232
+
transform: (q) =>q, // Reapply default transform for query
0 commit comments