static-pinkS
Refine3y ago
5 replies
static-pink

Issue in Caching using refine's hooks

Caching isn't probably working as intended in refine's hooks. I am using the hook useOne as shown below
const { data: product_data, isLoading: loading_product_data } = useOne({
        resource: "products",
        id: router.query.id as string,
    });


Firstly, there is no way to set a unique name to product_data like associating it with the product id just like in React Query.
Secondly, when I try to change to another page and then come back to this show product page, these get requests are made again. There is no caching.

Thirdly, I also wanted to suggest refine.dev's developers to make the product_data (on in general the key, to be accessible like a context just like React Query does.
Was this page helpful?