Skip to content

Commit

Permalink
Merge pull request #1065 from marcchehab/patch-1
Browse files Browse the repository at this point in the history
Fix React warning about unique "key" prop
  • Loading branch information
rufuspollock committed Mar 29, 2024
2 parents 3aac4da + 9e73410 commit d898b5a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/core/src/ui/SiteToc/SiteToc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ export const SiteToc: React.FC<Props> = ({ currentPath, nav }) => {

return (
<nav data-testid="lhs-sidebar" className="flex flex-col space-y-3 text-sm">
{sortNavGroupChildren(nav).map((n) => (
<NavComponent item={n} isActive={false} />
{sortNavGroupChildren(nav).map((n, index) => (
<NavComponent key={index} item={n} isActive={false} />
))}
</nav>
);
Expand Down Expand Up @@ -96,8 +96,8 @@ const NavComponent: React.FC<{
leaveTo="transform scale-95 opacity-0"
>
<Disclosure.Panel className="flex flex-col space-y-3 pl-5 mt-3">
{sortNavGroupChildren(item.children).map((subItem) => (
<NavComponent item={subItem} isActive={false} />
{sortNavGroupChildren(item.children).map((subItem, index) => (
<NavComponent key={index} item={subItem} isActive={false} />
))}
</Disclosure.Panel>
</Transition>
Expand Down

0 comments on commit d898b5a

Please sign in to comment.