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

后端 未结 7 1155
抹茶落季
抹茶落季 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:23

    Just add onPress props in your card

      {console.log('onclick')}}
                              style={styles.item}
                              status="basic"
                              header={(headerProps) =>
                                this.renderItemHeader(headerProps, item)
                              }>
                              {item.description}
                            
    

提交回复
热议问题