Skip to content

Commit 29f57f4

Browse files
committed
fix doc
1 parent 364ce4c commit 29f57f4

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
lines changed

docs/ReferenceFieldBase.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -268,14 +268,20 @@ const PostList = () => (
268268
render={({ data, isPending }) => (
269269
<>
270270
{!isPending &&
271-
data.map({ title, author_id }) => (
272-
<div>
273-
<h3>{title}</h3>
274-
<ReferenceFieldBase source="author_id" reference="authors">
275-
<AuthorView />
276-
</ReferenceFieldBase>
277-
</div>
278-
)}
271+
data.map(author => (
272+
<RecordContextProvider
273+
value={author}
274+
key={author.id}
275+
>
276+
<div>
277+
<h3>{author.title}</h3>
278+
<ReferenceFieldBase source="author_id" reference="authors">
279+
<AuthorView />
280+
</ReferenceFieldBase>
281+
</div>
282+
</RecordContextProvider>
283+
))
284+
}
279285
</>
280286
)}
281287
/>

docs/ReferenceManyFieldBase.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@ export const PostList = () => (
8080
render={({ data, isPending }) => (
8181
<>
8282
{!isPending &&
83-
data.map(author => (
83+
data.map(record => (
8484
<RecordContextProvider
85-
value={author}
86-
key={author.id}
85+
value={record}
86+
key={record.id}
8787
>
8888
<ReferenceManyFieldBase reference="comments" target="post_id">
8989
<CustomAuthorView source="name"/>

0 commit comments

Comments
 (0)