How to add a link to a List in material-ui 1.0?

Luis F. picture Luis F. · Nov 9, 2017 · Viewed 23.9k times · Source

The following messes with the onClick animation (the ListItem turns red):

<List>
  <a href="https://www.google.com">
    <ListItem button>
       <ListItemText primary="Google" />
     </ListItem>
   </a>
 </List>

While adding the link inside ListItem, only makes the transition work if ListItemText is clicked, which is not what I want. What is the correct way to add a link?

Answer

Julian Botia picture Julian Botia · Jan 17, 2018

to use with "react-router-dom"

import { Link } from "react-router-dom";
<ListItem button component={Link} to="/design">

the example is based in this section: docs