-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Closed
Description
Setting keepPreviousData option to true does not preserve previous stale data when the query key changes but before refetch is called, as described in #419. There have been some API changes from v1 to v2 so it is possible that this is intentional but not well documented. Sample code:
const [dateRange, setDateRange] = React.useState([today, today]);
const {data, latestData, resolvedData, error, refetch, isFetching} = usePaginatedQuery(
[dateRange[0], dateRange[1]], // should not refetch when date range changes
searchFx,
{enabled: false, keepPreviousData: true} // have tried with and without keepPreviousData
);
// only search when the button is clicked
return <Button onClick={refetch}>Search</Button>
A similar configuration was working in v1.5.10
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels