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 29 forks source link

Parent Menu issue #19

Open baratdev opened 3 years ago

baratdev commented 3 years ago

What if i don't want to put a link on parent menu if i remove itemId key from it console shows me warning of unique key, kindly please suggest how to remove link from Parent menu only submenu have link.There should be two different key for link and for key , so if someone dont want to add link on parent menu so he can simply remove it and key value in "key" so that he cannot get warning of unique key issue.

abhijithvijayan commented 3 years ago

Will look into this

sandeepjadhav commented 2 years ago

I used trick here to solve parent key link issue:

  1. just pass null value to the parents itemId: ''
  2. And in <Navigation onSelect={({itemId}) => { // maybe push to the route only if item id is not null }} />
mdasiff commented 2 years ago

is there a way to add my own class to parent and child menu?