Skip to content

Commit d898e60

Browse files
erwanMarmelabMadeorsk
authored andcommitted
use new props in the doc
1 parent 66e9a36 commit d898e60

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

docs/ReferenceManyFieldBase.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -135,14 +135,15 @@ export const AuthorShow = () => (
135135
<ShowBase>
136136
<ReferenceManyFieldBase label="Books" reference="books" target="author_id">
137137
<WithListContext
138-
render={({ isPending, data }) => (
138+
loading={<p>Loading...</p>}
139+
render={({ data }) => (
139140
<ul>
140-
{!isPending &&
141-
data.map(book => (
142-
<li key={book.id}>
143-
<i>{book.title}</i>, published on {book.published_at}
144-
</li>
145-
))}
141+
{data.map(book => (
142+
<li key={book.id}>
143+
<i>{book.title}</i>, published on
144+
{book.published_at}
145+
</li>
146+
))}
146147
</ul>
147148
)}
148149
/>
@@ -360,12 +361,12 @@ In the example below, both lists use the same reference ('books'), but their sel
360361
}}
361362
>
362363
<WithListContext
363-
render={({ isPending, data }) => (
364+
loading={<p>Loading...</p>}
365+
render={({ data }) => (
364366
<>
365-
{!isPending &&
366-
data.map(book => (
367-
<p key={book.id}>{book.title}</p>
368-
))}
367+
{data.map(book => (
368+
<p key={book.id}>{book.title}</p>
369+
))}
369370
</>
370371
)}
371372
/>

0 commit comments

Comments
 (0)