reactjs - I try to make my Material-UI RaisedButton link to an external url without success? -
as question in title state.
playing react, react-router , material-ui , in 1 place want make action button in card component link external url, without success.
i'm thinking of adding event handler use window.open, must smarter way?
i did find solution, before code looked this.
<cardactions> <raisedbutton href={this.props.url} label="ok" /> </cardactions> the solution simple:
<cardactions> <a href={this.props.url} target="_blank"> <raisedbutton label="ok" /> </a> </cardactions>
you can wrap <raisedbutton /> <link /> component internal routing.
<link to={this.props.carditem.resourceurl}> <raisedbutton label="ok" /> </link> and wrap simple <a> tag extrenal:
<a href={this.props.carditem.resourceurl}> <raisedbutton label="ok" /> </a>
Comments
Post a Comment