abhijithvijayan / react-minimal-side-navigation

Minimal side navigation component for React
https://codesandbox.io/s/react-minimal-side-navigation-example-y299d?file=/src/components/NavSidebar.jsx
MIT License
67 stars 28 forks source link

Unique Key Warning. #17

Open baratdev opened 3 years ago

baratdev commented 3 years ago

index.js:1 Warning: Each child in a list should have a unique "key" prop.

how i can resolve this issue where i have to add unique key, I'm pasting my code here please guide me.

<Navigation activeItemId={location.pathname} onSelect={({ itemId }) => { history.push(itemId); }} items={[ { title: "Dashboard", itemId: "/", elemBefore: () => , }, { title: "Management", //itemId: "/management", elemBefore: () => , subNav: [ { title: "Projects", itemId: "/about", elemBefore: () => , }, { title: "Members", itemId: "/", elemBefore: () => , }, ], }, { title: "Another Item", itemId: "/another", subNav: [ { title: "Teams", itemId: "/management/teams", }, ], }, ]} />