Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Material-ui adding Link to Radio Button component from react-router

Hellou! I have 2 radiobuttons and I want to add a link. I tried to do it the way:

    <RadioButton
      value="/searchByArtistAndName"
      label="Artist and Name"
      style={styles.radioButton}
      containerElement={<Link to="/searchByArtistAndName"/>}
    />

But containerElement is not defined for RadioButton. Any idea?

like image 989
German Burgardt Avatar asked Oct 30 '22 16:10

German Burgardt


1 Answers

You can put any react component in the label property, not just a text string.

<RadioButton
  label={<Link to="/your_route" />}
  ...
/>
like image 60
Jeff McCloud Avatar answered Nov 09 '22 12:11

Jeff McCloud