-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
When using .extend, if you transform the data, and then extend onwards afterwards, the return type will be wrong.
To Reproduce
const test = createLoader({
useQueries: () => ({
queries: {
query1: useCreateQuery(async () => "foo" as const),
}
}),
}).extend({
transform: (data) => data.queries.query1.data,
}).extend({
onLoading: () => <div>Loading...</div>,
})
// Resolves to useQueries return instead of transform, which is incorrect
type Data = Types.InferLoaderData<typeof test>;Expected behavior
createLoader.extend should always resolve to correct return types.
Actual behavior
createLoader.extend does not resolve to correct return types when using transform in a .extend-chain, but not in the end of it.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working