You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It uses `dataProvider.getMany()` instead of `dataProvider.getOne()`[for performance reasons](#performance). When using several `<ReferenceFieldBase>` in the same page (e.g. in a `<DataTable>`), this allows to call the `dataProvider` once instead of once per row.
|`source`| Required |`string`| - | Name of the property to display |
76
+
|`reference`| Required |`string`| - | The name of the resource for the referenced records, e.g. 'posts' |
77
+
|`children`| Optional |`ReactNode`| - | React component to render the referenced record, the component need to use useReferenceFieldContext to access the context. |
78
+
|`render`| Optional |`(context) => ReactNode`| - | Function that takes the referenceFieldContext and render the referenced record. Will take priority on children props if both are set. |
79
+
|`empty`| Optional |`ReactNode`| - | What to render when the field has no value or when the reference is missing |
Alternatively you can pass a render prop instead of children to be able to inline the rendering. The render function will then receive the reference field context directly.
|`source`| Required |`string`| - | Name of the property to display |
107
-
|`reference`| Required |`string`| - | The name of the resource for the referenced records, e.g. 'posts' |
108
-
|`children`| Optional |`ReactNode`| - | React component to render the referenced record, the component need to use useReferenceFieldContext to access the context. |
109
-
|`render`| Optional |`(context) => ReactNode`| - | Function that takes the referenceFieldContext and render the referenced record. Will take priority on children props if both are set. |
110
-
|`empty`| Optional |`ReactNode`| - | What to render when the field has no value or when the reference is missing |
0 commit comments