Skip to content

Commit

Permalink
Merge pull request #9573 from Szulerinio/doc]-fix-jekyll-trying-to-pa…
Browse files Browse the repository at this point in the history
…rse-jsx-code

[Doc] fix jekyll trying to parse jsx code on <Edit> mutationOptions
  • Loading branch information
slax57 authored Jan 12, 2024
2 parents d589e64 + 9910dc1 commit 785dc9e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
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
2 changes: 1 addition & 1 deletion docs/Resource.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ The routing will map the component as follows:

* [`name`](#name)
* [`icon`](#icon)
* [`options`](#icon)
* [`options`](#options)
* [`recordRepresentation`](#recordrepresentation)

## `children`
Expand Down

0 comments on commit 785dc9e

Please sign in to comment.