useInfiniteQuery with RSCs
I'm using the useInfiniteQuery hook with Next 13, inside of the app directory.
An RSC loads the initial data, which then gets put into
This works perfectly. The rub is, on the page, the user can modify filters, which causes the querystring to change, and the RSC to reload data, and send down the updated data.
Is there a way to force the hook to sort of "reset" and revert back to this updated data? The workaround I'm currently using is to just say
around the component with the infinite query, so it re-renders at the React level when this search filters change. This works, but it's a bit of a hack.
An RSC loads the initial data, which then gets put into
initialData in the useInfiniteQuery hook.This works perfectly. The rub is, on the page, the user can modify filters, which causes the querystring to change, and the RSC to reload data, and send down the updated data.
Is there a way to force the hook to sort of "reset" and revert back to this updated data? The workaround I'm currently using is to just say
<Fragment key={queryString}>around the component with the infinite query, so it re-renders at the React level when this search filters change. This works, but it's a bit of a hack.