How to make the whole Card component clickable in Material UI using React JS?

后端 未结 7 1074
抹茶落季
抹茶落季 2021-01-31 03:44

Im using Material UI Next in a React project. I have the Card component which has an image(Card Media) and text(Card Text) inside it. I also have a button underneath the text. M

相关标签:
7条回答
  • 2021-01-31 04:24

    We can also use Link tag to make the whole Card component clickable and for navigation

    import { Link } from 'react-router-dom';
    function myCard() {
      return (
        <Link to={'/give_your_path'}>
         <Card>
          <Card text="This is text"/>
         </Card>
        </Link>
      );
    }
    
    0 讨论(0)
提交回复
热议问题