I am trying to make it so that when the user clicks my label, it opens up a new tab with the specified URL. It currently is not working. Any ideas what I am doing wrong or need to do in my method?
rerouteToGoogle= () => {
return <Link to="google.com" />
}
<MediaQuery query="(min-width: 550px)">
<div style={styles.alignText}>
<Label color='green' basic onClick={this.rerouteToGoogle} >CSV</Label>
</div>
</MediaQuery>
in your case rerouteToGoogle
renders a Link component. I believe what you're trying to achieve is opening the new tab link on click, not rendering it.
In this case just change your function to
rerouteToGoogle= () => window.open('www.google.com', "_blank")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With