Skip to content

Commit

Permalink
Merge pull request #10426 from marmelab/doc/backport_ReferenceManyToM…
Browse files Browse the repository at this point in the history
…any_error_support_doc

[Doc]: Backport `ReferenceManyToMany`'s error support documentation
  • Loading branch information
slax57 authored Dec 20, 2024
2 parents cd440fd + dd7e5c5 commit c49bdae
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 c49bdae

Please sign in to comment.