Skip to content

Commit 4fecbb2

Browse files
authoredFeb 25, 2024
fix(query): usePrefetch should only work for Query/Infinite types (#1235)
fixes #1234
1 parent 15e9033 commit 4fecbb2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎packages/query/src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1075,7 +1075,7 @@ ${doc}export const ${camel(
10751075
return ${queryResultVarName};
10761076
}\n
10771077
${
1078-
usePrefetch
1078+
usePrefetch && (type === QueryType.QUERY || type === QueryType.INFINITE)
10791079
? `${doc}export const ${camel(
10801080
`prefetch-${name}`,
10811081
)} = async <TData = Awaited<ReturnType<${dataType}>>, TError = ${errorType}>(\n queryClient: QueryClient, ${queryProps} ${queryArguments}\n ): Promise<QueryClient> => {

0 commit comments

Comments
 (0)
Please sign in to comment.