Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Doc] Fix jekyll trying to parse jsx code on <Edit mutationOptions> example snippet #9573

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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