helfi92 / material-ui-treeview

A React tree view for material-ui.
MIT License
47 stars 21 forks source link

Integrated with react router #33

Closed birendra-90 closed 5 years ago

birendra-90 commented 5 years ago

How do i integrate react router

helfi92 commented 5 years ago

By providing an href key to a leaf element in the tree material-ui-treeview will use the Link component of react-router-dom to perform the transition.

const tree = [
  {
    value: 'Parent A',
    nodes: [{ value: 'Child A', href: '/child-a' }, { value: 'Child B', href: '/child-b' }],
  },
];

// ...

<MuiTreeView tree={tree} />
birendra-90 commented 5 years ago

@helfi92 Thank you so much

helfi92 commented 5 years ago

You're welcome!