useSelect seems to ignore cached values.

I have quite simple useSelect, which fetches tenants.
I use global config
reactQuery: {
clientConfig: {
defaultOptions: {
queries: {
staleTime: 5 * 60 * 1000,
},
},
},
}
I use the hook:
const { selectProps: tenantSelectProps, queryResult } = useSelect({
resource: "tenants",
optionLabel: "name",
});
<Select {...tenantSelectProps} />

Now, when entering the page first time and rendering component tenant select loads with correct values, like it should. But when closing the page and returning to it (tenant list should be loaded from cache) - the select is empty.
If I disable staleTime in Refine global config of-course select populates, but tenants are fetched from network every time.

When I do this:
const options = queryResult.data?.data.map((item: any) => ({
label: item.name,
value: item.id,
}));
<Select {...tenantSelectProps} options={options} />
it works expected fetches first time, and subsequently loads from cache.

Does useSelect ignores values fetched from cache ?
Was this page helpful?