Skip to content

Commit 8ff89e9

Browse files
authored
Merge pull request #11072 from marmelab/fix-ReferenceOneField-doc
[Doc] Fix `<ReferenceOneField>` doc incorrectly mentions one of `children` or `render` is required
2 parents 54b1982 + 8b2353d commit 8ff89e9

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

docs/ReferenceOneField.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,15 @@ const BookShow = () => (
5959
| -------------- | -------- | ------------------------------------------- | -------------------------------- | ----------------------------------------------------------------------------------- |
6060
| `reference` | Required | `string` | - | The name of the resource for the referenced records, e.g. 'book_details' |
6161
| `target` | Required | string | - | Target field carrying the relationship on the referenced resource, e.g. 'book_id' |
62-
| `children` | Optional&nbsp;* | `ReactNode` | - | The Field element used to render the referenced record |
63-
| `render` | Optional&nbsp;* | `(ReferenceFieldContext) => ReactNode` | - | A function that takes the `ReferenceFieldContext` and returns a React element |
62+
| `children` | Optional | `ReactNode` | - | The Field element used to render the referenced record |
63+
| `render` | Optional | `(ReferenceFieldContext) => ReactNode` | - | A function that takes the `ReferenceFieldContext` and returns a React element |
6464
| `empty` | Optional | `ReactNode` | - | The text or element to display when the referenced record is empty |
6565
| `filter` | Optional | `Object` | `{}` | Used to filter referenced records |
6666
| `link` | Optional | `string | Function` | `edit` | Target of the link wrapping the rendered child. Set to `false` to disable the link. |
6767
| `offline` | Optional | `ReactNode` | - | The text or element to display when there is no network connectivity |
6868
| `queryOptions` | Optional | [`UseQueryOptions`](https://tanstack.com/query/v5/docs/react/reference/useQuery) | `{}` | `react-query` client options |
6969
| `sort` | Optional | `{ field: String, order: 'ASC' or 'DESC' }` | `{ field: 'id', order: 'ASC' }` | Used to order referenced records |
7070

71-
`*` You must provide either `children` or `render`.
72-
7371
`<ReferenceOneField>` also accepts the [common field props](./Fields.md#common-field-props).
7472

7573
## `children`

0 commit comments

Comments
 (0)