How to pass extra data to tanstack useMutation? How create custom useMutation? #9234
Unanswered
alkosorukov
asked this question in
Q&A
Replies: 2 comments
-
this is pretty hard to type generically. the version where you close over |
Beta Was this translation helpful? Give feedback.
0 replies
-
https://codesandbox.io/p/sandbox/chxx2k?file=%2Fsrc%2FcustomUseMutation.ts%3A23%2C18 How to fix typing errors? |
Beta Was this translation helpful? Give feedback.
0 replies
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.
Uh oh!
There was an error while loading. Please reload this page.
-
I have several requests to add and change data:
Now, along with this data, I need to transfer the user's ID, which is stored in zustand: const {user} = userModel(). I could write something like
but there are a lot of requests and it may be necessary to add something else. How to write custom useMutation so that it takes and adds what is needed?
I assumed something like:
Beta Was this translation helpful? Give feedback.
All reactions