You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am having trouble creating a custom compare function when using useSWRInfinite.
If you looks at the console of a, and b when loading more items, the data that it compares changes. It first compares individual requests, then it compares the arrays of individual requests. This makes it difficult, for example, if I want to ignore a certain property that changes on every request (like a timestamp), or reduce and only compare IDs. Is this intended? Any suggestion about how to handle?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello!
I am having trouble creating a custom
compare
function when usinguseSWRInfinite
.If you looks at the console of
a
, andb
when loading more items, the data that it compares changes. It first compares individual requests, then it compares the arrays of individual requests. This makes it difficult, for example, if I want to ignore a certain property that changes on every request (like a timestamp), or reduce and only compare IDs. Is this intended? Any suggestion about how to handle?https://codesandbox.io/s/swr-infinite-forked-ebqhb?file=/src/App.js
Thank you so much!
Gyles Fohl
Beta Was this translation helpful? Give feedback.
All reactions