Skip to content

Commit

Permalink
fix: fix errors regarding key props
Browse files Browse the repository at this point in the history
  • Loading branch information
Mednoob authored and mzrtamp committed Mar 7, 2024
1 parent bae0ee0 commit e6b114a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/components/Dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ export default function Dropdown({ head, items }: { head: ReactNode; items: Reac
</div>
{open && (
<div className="flex flex-col">
{items.map(x => (
<div className="border-l border-black ml-2 pl-2 hover:bg-white hover:bg-opacity-20">{x}</div>
{items.map((x, i) => (
<div key={i} className="border-l border-black ml-2 pl-2 hover:bg-white hover:bg-opacity-20">{x}</div>
))}
</div>
)}
Expand Down
12 changes: 6 additions & 6 deletions src/pages/test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import Dropdown from "../components/Dropdown";
function SampleDropdown() {
return (
<Dropdown head="Schemas" items={[
<Dropdown head="Schema 1" items={[
<p>Table A</p>,
<p>Table B</p>
<Dropdown key={0} head="Schema 1" items={[
<p key={0}>Table A</p>,
<p key={1}>Table B</p>
]} />,
<Dropdown head="Schema 2" items={[
<p>Table User</p>,
<p>Table Player</p>
<Dropdown key={1} head="Schema 2" items={[
<p key={0}>Table User</p>,
<p key={1}>Table Player</p>
]} />
]} />
)
Expand Down

0 comments on commit e6b114a

Please sign in to comment.