I have this Icon from material UI, I wish to make it clickable and open a new window to www.linkedin.com
should I use href="Linkedin.com" ? or add onClick ? I wish it to open a new tab/window aswell
This should do using Material-UI Icons:
import LinkedInIcon from '@material-ui/icons/LinkedIn';
import IconButton from '@material-ui/core/IconButton';
<IconButton aria-label="Linkedin.com" onClick={() => window.open('https://www.Linkedin.com')}>
<LinkedInIcon fontSize="large" />
</IconButton>
To open a new page:
onClick={() => window.open(newPageUrl, "_blank")}
To open on the same one:
onClick={() => window.location.replace(newPageUrl)}
CodeSandBox
there is two way which can help you
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