Skip to content

Commit f45b02d

Browse files
committed
chore: fix loading products error
1 parent 872c6fa commit f45b02d

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { keepPreviousData } from "@tanstack/react-query";
2+
13
import { productsQuery } from "@/lib/api/products/products-list/products-list-query";
24
import { useQuery } from "@/lib/query";
35
import type { QueryParams } from "@/types/query-params";
@@ -6,4 +8,4 @@ export { productsLoader } from "@/lib/api/products/products-list/products-list-q
68
export { productsQuery };
79

810
export const useProductsQuery = (params?: QueryParams) =>
9-
useQuery(productsQuery(params));
11+
useQuery({ ...productsQuery(params), placeholderData: keepPreviousData });

0 commit comments

Comments
 (0)