You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -122,6 +129,16 @@ type UseMutationResult<Definition> = {
122
129
};
123
130
```
124
131
132
+
:::tip
133
+
134
+
The generated `UseMutation` hook will cause a component to re-render by default after the trigger callback is fired as it affects the properties of the result. If you want to call the trigger but don't care about subscribing to the result with the hook, you can use the `selectFromResult` option to limit the properties that the hook cares about.
135
+
136
+
Passing a completely empty object will prevent the hook from causing a re-render at all, e.g.
137
+
```ts
138
+
selectFromResult: () => ({})
139
+
```
140
+
:::
141
+
125
142
- **Returns**: a tuple containing:
126
143
- `trigger`: a function that triggers an update to the data based on the provided argument. The trigger function returns a promise with the properties shown above that may be used to handle the behaviour of the promise.
127
144
- `mutationState`: a query status object containing the current loading state and metadata about the request
0 commit comments