Mutations in different components with the same parameters #2845
Replies: 2 comments
-
Example, we have several components:
In the List we have filtering. Next, we need to make a request taking into account this filtering from Detail. You can drag all the filter parameters into the details, but there is also pagination there and something else may appear, so we decided to transfer the SWR key to the Details component. |
Beta Was this translation helpful? Give feedback.
-
Now the question is the transfer method, as I wrote in the adjacent discussion #2846 in enterprise we are afraid to use something undocumented, so we used redux to transfer the SWR key. Tell me, maybe there is some kind of best practice inside the SWR |
Beta Was this translation helpful? Give feedback.
-
The essence of the problem:
In one component we call the SWR hook with parameters, in another component we need to call a mutation of this hook with the same parameters.
There are several possible solutions. How to do it right? I couldn't find any information about this in the doc. I propose to discuss.
Beta Was this translation helpful? Give feedback.
All reactions