Skip to content

Commit 3a4c988

Browse files
committed
add missing react keys
1 parent 3caf7f9 commit 3a4c988

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/ApiDocs.res

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ module RightSidebar = {
6262
}
6363
let title = `${Option.isSome(deprecatedIcon) ? "Deprecated " : ""}` ++ name
6464
let result =
65-
<li className="my-3">
65+
<li className="my-3" key={href}>
6666
<a
6767
title
6868
className="flex items-center w-full font-normal text-14 text-gray-40 leading-tight hover:text-gray-80"
@@ -125,12 +125,12 @@ module SidebarTree = {
125125
switch hasChildren {
126126
| true =>
127127
let open_ =
128-
node.path->Array.join("/") ===
128+
href ===
129129
moduleRoute
130130
->Array.slice(~start=0, ~end=Array.length(moduleRoute) - 1)
131131
->Array.join("/")
132132

133-
<details key={node.name} open_>
133+
<details key={href} open_>
134134
<summary className={summaryClassName ++ classNameActive}>
135135
<Next.Link className={"inline-block w-10/12"} href>
136136
{node.name->React.string}
@@ -148,7 +148,7 @@ module SidebarTree = {
148148
}}
149149
</details>
150150
| false =>
151-
<li className={"list-none mt-1 leading-4"} key={node.name}>
151+
<li className={"list-none mt-1 leading-4"} key={href}>
152152
<summary className={summaryClassName ++ classNameActive}>
153153
<Next.Link className={"block"} href> {node.name->React.string} </Next.Link>
154154
</summary>
@@ -189,9 +189,10 @@ module SidebarTree = {
189189
<VersionSelect
190190
onChange
191191
version
192-
availableVersions=Constants.coreVersions
192+
availableVersions=Constants.stdlibVersions
193193
nextVersion=?Constants.nextVersion
194194
/>
195+
195196
| None => React.null
196197
}}
197198
</div>
@@ -314,21 +315,21 @@ let default = (props: props) => {
314315
| Value({name, signature, docstrings, deprecated}) =>
315316
let code = String.replaceRegExp(signature, /\\n/g, "\n")
316317
let slugPrefix = "value-" ++ name
317-
<>
318+
<React.Fragment key={slugPrefix}>
318319
<H2 id=slugPrefix> {name->React.string} </H2>
319320
<DeprecatedMessage deprecated />
320321
<CodeExample code lang="rescript" />
321322
<DocstringsStylize docstrings slugPrefix />
322-
</>
323+
</React.Fragment>
323324
| Type({name, signature, docstrings, deprecated}) =>
324325
let code = String.replaceRegExp(signature, /\\n/g, "\n")
325326
let slugPrefix = "type-" ++ name
326-
<>
327+
<React.Fragment key={slugPrefix}>
327328
<H2 id=slugPrefix> {name->React.string} </H2>
328329
<DeprecatedMessage deprecated />
329330
<CodeExample code lang="rescript" />
330331
<DocstringsStylize docstrings slugPrefix />
331-
</>
332+
</React.Fragment>
332333
}
333334
})
334335

0 commit comments

Comments
 (0)