-
https://stackoverflow.com/questions/62340697/react-query-how-to-usequery-when-button-is-clicked suggests how to run a query on an event such as a button click. However if you want to use Is that just an omission from the typedefs, or is this a new feature request? It would also be good to include this in the documentation. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
As opposed to queries, mutations don’t run automatically. Just call the |
Beta Was this translation helpful? Give feedback.
As opposed to queries, mutations don’t run automatically. Just call the
mutate
function that gets returned from useMutation when you click the button, like in the documentation here: https://react-query.tanstack.com/guides/mutations