Skip to content

Commit

Permalink
[Doc]: Backport ReferenceManyToMany's error support documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
erwanMarmelab committed Dec 19, 2024
1 parent cd440fd commit dd7e5c5
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions docs/ReferenceManyToManyInput.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,25 @@ By default, react-admin displays at most 25 entries from the associative table (
</ReferenceManyToManyInput>
```

You can also use it to pass an `onError` function as follows:

{% raw %}

```tsx
<ReferenceManyToManyInput
reference="venues"
through="performances"
using="band_id,venue_id"
mutationOptions={{
onError: (error, step, data) => console.warn({ error, step, data })
}}
>
{/* ... */}
</ReferenceManyToManyInput>
```

{% endraw %}

## `perPageChoices`

`<ReferenceManyToManyInput>` displays a list of possible values from the reference table (e.g. `venues`) as suggestions in the input. It uses the `getList()` dataProvider call to fetch these possible values.
Expand Down

0 comments on commit dd7e5c5

Please sign in to comment.