I have this annoying problem. I have history list with pagination. For every page I fetch the data with useSWR
. The pagination works fine, but when I add a new entry in history list (and trigger the mutate) I got new history data only on the current page. When I go page up or page down, the useSWR
use the cached data for every other page in history list. In ReactQuery there is an option to disable caching, but it does not exist in new useSWR
.
So my question is, can I do mutate(key)
on prop or state update? Or if not, can I disable caching or force useSWR
on every prop or state change?