Skip to content

Commit 2fe32c4

Browse files
Merge pull request #8068 from marmelab/doc-ts-improvements
[Doc] Add `label` prop for `<ReferenceInput>` and `<ReferenceArrayInput>` in docs
2 parents cc4df1d + affaa3a commit 2fe32c4

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

docs/ReferenceArrayInput.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ import { ReferenceArrayInput, SelectArrayInput } from 'react-admin';
4646
| Prop | Required | Type | Default | Description |
4747
|--------------------|----------|---------------------------------------------|------------------------------------|---------------------------------------------------------------------------------------------------------------------|
4848
| `filter` | Optional | `Object` | `{}` | Permanent filters to use for getting the suggestion list |
49+
| `label` | Optional | `string` | - | Useful only when `ReferenceArrayInput` is in a Filter array, the label is used as the Filter label. |
4950
| `page` | Optional | `number` | 1 | The current page number |
5051
| `perPage` | Optional | `number` | 25 | Number of suggestions to show |
5152
| `reference` | Required | `string` | '' | Name of the reference resource, e.g. 'posts'. |
5253
| `sort` | Optional | `{ field: String, order: 'ASC' or 'DESC' }` | `{ field: 'id', order: 'DESC' }` | How to order the list of suggestions |
5354
| `enableGetChoices` | Optional | `({q: string}) => boolean` | `() => true` | Function taking the `filterValues` and returning a boolean to enable the `getList` call. |
5455

55-
5656
**Note**: `<ReferenceArrayInput>` doesn't accept the [common input props](./Inputs.md#common-input-props) ; it is the responsability of children to apply them.
5757

5858
## Usage

docs/ReferenceInput.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ import { ReferenceInput, SelectInput } from 'react-admin';
2626
| Prop | Required | Type | Default | Description |
2727
|--------------------|----------|---------------------------------------------|----------------------------------|-------------------------------------------------------------------------------------------------------------------|
2828
| `filter` | Optional | `Object` | `{}` | Permanent filters to use for getting the suggestion list |
29+
| `label` | Optional | `string` | - | Useful only when `ReferenceInput` is in a Filter array, the label is used as the Filter label. |
2930
| `page` | Optional | `number` | 1 | The current page number |
3031
| `perPage` | Optional | `number` | 25 | Number of suggestions to show |
3132
| `reference` | Required | `string` | '' | Name of the reference resource, e.g. 'posts'. |
3233
| `sort` | Optional | `{ field: String, order: 'ASC' or 'DESC' }` | `{ field: 'id', order: 'DESC' }` | How to order the list of suggestions |
3334
| `enableGetChoices` | Optional | `({q: string}) => boolean` | `() => true` | Function taking the `filterValues` and returning a boolean to enable the `getList` call. |
3435

35-
3636
**Note**: `<ReferenceInput>` doesn't accept the [common input props](./Inputs.md#common-input-props) ; it is the responsability of children to apply them.
3737

3838
## Usage

docs/Upgrade.md

+2
Original file line numberDiff line numberDiff line change
@@ -2709,6 +2709,8 @@ const UserInput = [
27092709
]
27102710
```
27112711

2712+
**Note**: `<ReferenceInput>` and `<ReferenceArrayInput>` still accept the `label` prop, which is used as the Filter label when they are used in a Filter array.
2713+
27122714
#### `<ReferenceArrayInput>` No Longer Provides a `ListContext`
27132715

27142716
As the `ChoicesContext` now provide an API very similar to the `ListContext`, it no longer sets up a `ListContext`. If you used this to display a `<Datagrid>`, we will soon provide the `<DatagridInput>` for this purpose.

0 commit comments

Comments
 (0)