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
Copy file name to clipboardExpand all lines: docs/src/pages/guides/mutations.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,7 +44,7 @@ A mutation can only be in one of the following states at any given moment:
44
44
-`isError` or `status === 'error'` - The mutation encountered an error
45
45
-`isSuccess` or `status === 'success'` - The mutation was successful and mutation data is available
46
46
47
-
Beyond those primary state, more information is available depending on the state the mutation:
47
+
Beyond those primary states, more information is available depending on the state of the mutation:
48
48
49
49
-`error` - If the mutation is in an `isError` state, the error is available via the `error` property.
50
50
-`data` - If the mutation is in a `success` state, the data is available via the `data` property.
@@ -53,10 +53,10 @@ In the example above, you also saw that you can pass variables to your mutations
53
53
54
54
Even with just variables, mutations aren't all that special, but when used with the `onSuccess` option, the [Query Client's `invalidateQueries` method](../reference/QueryClient#queryclientinvalidatequeries) and the [Query Client's `setQueryData` method](../reference/QueryClient#queryclientsetquerydata), mutations become a very powerful tool.
55
55
56
-
> IMPORTANT: The `mutate` function is an asynchronous function, which means you cannot use it directly in an event callback. If you need to access the event in `onSubmit` you need to wrap `mutate` in another function. This is due to [React event pooling](https://reactjs.org/docs/events.html#event-pooling).
56
+
> IMPORTANT: The `mutate` function is an asynchronous function, which means you cannot use it directly in an event callback in **React 16 and earlier**. If you need to access the event in `onSubmit` you need to wrap `mutate` in another function. This is due to [React event pooling](https://reactjs.org/docs/legacy-event-pooling.html).
Copy file name to clipboardExpand all lines: docs/src/pages/reference/useMutation.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,15 +46,15 @@ mutate(variables, {
46
46
- This function will fire before the mutation function is fired and is passed the same variables the mutation function would receive
47
47
- Useful to perform optimistic updates to a resource in hopes that the mutation succeeds
48
48
- The value returned from this function will be passed to both the `onError` and `onSettled` functions in the event of a mutation failure and can be useful for rolling back optimistic updates.
0 commit comments