Replies: 1 comment 1 reply
-
We can consider passing the bound mutate method as props into Post component. 🤔
|
Beta Was this translation helpful? Give feedback.
1 reply
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.
-
I'm stuck with mutate system. I'm going to try to explain my situation, I hope I can make it.
I'm working on a social media app, it's something like a combination of Instagram and Twitter. We have a weird RestAPI design in here. for example, we have three endpoints, and let's say A, B, C. all of them return the same type object array(post[]) and have three routes for these endpoints.
as you can see, I need to update cached data but I don't know how can I pass the correct SWR key to mutate function in that delete handler. In the end, I have many keys because of API design. Also, I use
useSWRInfinite
too, and it generates new keys when scrolling down.I can't use the
useUser
pattern for each endpoint with this case because there are many endpoints and filter queries.Beta Was this translation helpful? Give feedback.
All reactions