@@ -46,7 +46,7 @@ const BookShow = () => (
4646
4747// with BookDetails something like
4848const BookDetails = ({ source }) => {
49- const context = useReferenceOneFieldContext ({
49+ const context = useReferenceFieldContext ({
5050 reference,
5151 target,
5252 });
@@ -76,7 +76,7 @@ const BookDetails = ({ source }) => {
7676| ` reference ` | Required | ` string ` | - | The name of the resource for the referenced records, e.g. 'book_details' |
7777| ` target ` | Required | string | - | Target field carrying the relationship on the referenced resource, e.g. 'book_id' |
7878| ` children ` | Optional\* | ` Element ` | - | React component to render the referenced record. |
79- | ` render ` | Optional\* | ` (referenceFieldContext ) => Element ` | - | A function that takes the reference field context and return a React element |
79+ | ` render ` | Optional\* | ` (ReferenceFieldContext ) => Element ` | - | A function that takes the ` ReferenceFieldContext ` and return a React element |
8080| ` empty ` | Optional | ` ReactNode ` | - | The text or element to display when the referenced record is empty |
8181| ` filter ` | Optional | ` Object ` | ` {} ` | Used to filter referenced records |
8282| ` link ` | Optional | `string | Function` | ` edit ` | Target of the link wrapping the rendered child. Set to ` false ` to disable the link. |
@@ -90,11 +90,11 @@ const BookDetails = ({ source }) => {
9090## ` children `
9191
9292You can pass any component of your own as children, to render the referenced record as you wish.
93- You can access the list context using the ` useReferenceOneFieldController ` hook.
93+ You can access the list context using the ` useReferenceFieldContext ` hook.
9494
9595``` jsx
9696const BookDetails = () => {
97- const { isPending , error , referenceRecord } = useReferenceOneFieldContext ({
97+ const { isPending , error , referenceRecord } = useReferenceFieldContext ({
9898 reference,
9999 target,
100100 });
0 commit comments