Skip to content

Commit db58034

Browse files
committed
Fix React key error
1 parent 890a89a commit db58034

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

src/components/PostTemplate.js

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ const PostTemplate = ({ content, frontmatter, slug, permalink }) => {
3535
<Composes>
3636
Composes:{" "}
3737
{frontmatter.composes.map((title, i) => (
38-
<>
38+
<React.Fragment key={i}>
3939
<Link to={`/${title}`}>{title}</Link>
4040
{i < frontmatter.composes.length - 1 ? "," : ""}{" "}
41-
</>
41+
</React.Fragment>
4242
))}
4343
</Composes>
4444
)}
@@ -89,17 +89,24 @@ const PostTemplate = ({ content, frontmatter, slug, permalink }) => {
8989
))}
9090

9191
{permalink === true && (
92-
<LinksLi key="divjoy">
92+
<LinksLi key="reactHooksCourse">
9393
<a
94-
href="https://divjoy.com?utm_source=usehooks&utm_medium=website&utm_campaign=usehooks-post-links"
94+
href="https://ui.dev/react-hooks"
9595
onClick={() => {
96-
analytics.track("clickExtraDivjoyLink");
96+
analytics.track("clickHooksCourseLink");
9797
}}
9898
>
99-
Divjoy
99+
Our React Hooks course
100+
</a>{" "}
101+
- <span>Find out more by visiting </span>
102+
<a
103+
href="https://ui.dev/react-hooks"
104+
onClick={() => {
105+
analytics.track("clickHooksCourseLink");
106+
}}
107+
>
108+
ui.dev
100109
</a>{" "}
101-
-{" "}
102-
<span>React starter kit from the creator of usehooks.com</span>
103110
</LinksLi>
104111
)}
105112
</ul>

0 commit comments

Comments
 (0)