material-ui icon indicating copy to clipboard operation
material-ui copied to clipboard

material-ui MenuItem vs react-router

Open anhuisunfei opened this issue 10 years ago • 1 comments

material-ui MenuItem use react-router,How to do it?

anhuisunfei avatar Jan 27 '16 06:01 anhuisunfei

Make sure you have a history singleton set up with React Router. (https://www.npmjs.com/package/history)

<Router history={history}>

You can then use the onTouchTap prop for MenuItem to handle path changes. http://www.material-ui.com/#/components/menu#menuitem-properties Inside the handling code you can use the history singleton to push changes to the routing.

Stansbridge avatar Jan 27 '16 18:01 Stansbridge