How to use cache Data when page change by useSWRMutation #2444
Unanswered
vaynevayne
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
step1 : the title is '', page :1,
step2 : the title is '', page :2,
step3(option1) : the title is '', page :1, // want to usecache data, because title is not change
step3(option2) : the title is 'xxx', page :1, // want to fetch , because title is change
how to complete it ?
and i need set all query params into queryKey?
like
useSWRMutation(["/posts",title] sendRequest)
, and, if i do this, how to use cache data?codesandbox : https://codesandbox.io/s/admiring-bartik-uzzz46?file=/src/App.tsx
Beta Was this translation helpful? Give feedback.
All reactions