Skip to content

Commit

Permalink
Fix the <ReferenceManyToManyInput mutationOption={{onError}}> doc
Browse files Browse the repository at this point in the history
  • Loading branch information
erwanMarmelab committed Jan 22, 2025
1 parent 17407ad commit 8b37849
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions docs/ReferenceManyToManyInput.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,40 +210,40 @@ You can for instance use it to pass [a custom meta](./Actions.md#meta-parameter)

{% endraw %}

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

By default, react-admin displays at most 25 entries from the associative table (e.g. 25 `performances`). You can change the limit by setting the `perPage` prop:
{% raw %}

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

You can also use it to pass an `onError` function as follows:
{% endraw %}

{% raw %}
## `perPage`

By default, react-admin displays at most 25 entries from the associative table (e.g. 25 `performances`). You can change the limit by setting the `perPage` prop:

```tsx
<ReferenceManyToManyInput
reference="venues"
through="performances"
using="band_id,venue_id"
mutationOptions={{
onError: (error, step, data) => console.warn({ error, step, data })
}}
perPage={10}
>
{/* ... */}
</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 8b37849

Please sign in to comment.