Skip to content

Commit c49bdae

Browse files
authored
Merge pull request marmelab#10426 from marmelab/doc/backport_ReferenceManyToMany_error_support_doc
[Doc]: Backport `ReferenceManyToMany`'s error support documentation
2 parents cd440fd + dd7e5c5 commit c49bdae

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

docs/ReferenceManyToManyInput.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,25 @@ By default, react-admin displays at most 25 entries from the associative table (
225225
</ReferenceManyToManyInput>
226226
```
227227

228+
You can also use it to pass an `onError` function as follows:
229+
230+
{% raw %}
231+
232+
```tsx
233+
<ReferenceManyToManyInput
234+
reference="venues"
235+
through="performances"
236+
using="band_id,venue_id"
237+
mutationOptions={{
238+
onError: (error, step, data) => console.warn({ error, step, data })
239+
}}
240+
>
241+
{/* ... */}
242+
</ReferenceManyToManyInput>
243+
```
244+
245+
{% endraw %}
246+
228247
## `perPageChoices`
229248

230249
`<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.

0 commit comments

Comments
 (0)