Skip to content

Commit 3780f50

Browse files
committed
fix: move orphaned title to component structure for document-field example
1 parent 037757a commit 3780f50

File tree

1 file changed

+19
-17
lines changed

1 file changed

+19
-17
lines changed

examples/document-field/src/pages/index.tsx

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,26 @@ import { fetchGraphQL, gql } from '../utils'
55
type Author = { id: string, name: string, posts: { id: string, slug: string, title: string }[] }
66

77
export default function Index ({ authors }: { authors: Author[] }) {
8-
<h1>Keystone Blog Project - Home</h1>
98
return (
10-
<ul>
11-
{authors.map(author => (
12-
<li key={author.id}>
13-
<h2>
14-
<Link href={`/author/${author.id}`}>{author.name}</Link>
15-
</h2>
16-
<ul>
17-
{author.posts.map(post => (
18-
<li key={post.id}>
19-
<Link href={`/post/${post.slug}`}>{post.title}</Link>
20-
</li>
21-
))}
22-
</ul>
23-
</li>
24-
))}
25-
</ul>
9+
<>
10+
<h1>Keystone Blog Project - Home</h1>
11+
<ul>
12+
{authors.map(author => (
13+
<li key={author.id}>
14+
<h2>
15+
<Link href={`/author/${author.id}`}>{author.name}</Link>
16+
</h2>
17+
<ul>
18+
{author.posts.map(post => (
19+
<li key={post.id}>
20+
<Link href={`/post/${post.slug}`}>{post.title}</Link>
21+
</li>
22+
))}
23+
</ul>
24+
</li>
25+
))}
26+
</ul>
27+
</>
2628
)
2729
}
2830

0 commit comments

Comments
 (0)