Skip to content

Commit

Permalink
fix jekyll trying to parse jsx code - mutation options
Browse files Browse the repository at this point in the history
  • Loading branch information
Szulerinio authored Jan 10, 2024
1 parent c25e4e1 commit 0bd8299
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/Edit.md
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ The default `onSuccess` function is:

**Tip**: When you use `mutationMode="pessimistic"`, the `onSuccess` function receives the response from the `dataProvider.update()` call, which is the created/edited record (see [the dataProvider documentation for details](./DataProviderWriting.md#response-format)). You can use that response in the success side effects:

{% raw %}
```jsx
import * as React from 'react';
import { useNotify, useRefresh, useRedirect, Edit, SimpleForm } from 'react-admin';
Expand All @@ -389,6 +390,7 @@ const PostEdit = () => {
);
}
```
{% endraw %}

**Tip**: If you want to have different success side effects based on the button clicked by the user (e.g. if the creation form displays two submit buttons, one to "save and redirect to the list", and another to "save and display an empty form"), you can set the `mutationOptions` prop on [the `<SaveButton>` component](./SaveButton.md), too.

Expand Down

0 comments on commit 0bd8299

Please sign in to comment.