Last active
February 11, 2020 15:31
-
-
Save AllGistsEqual/3dd3229584a08d5dc1c0ae97ac8f62b4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// our SpecialLink.jsx | |
const SpecialLink = (props) => { | |
const { url, label, ...additionalProps } = props | |
return ( | |
<a href={url} ...additionalProps> | |
{label} | |
</a> | |
) | |
} | |
// somewhere in our projects where we imported the component | |
<SpecialLink | |
url="https://some.url.com" | |
label="Link to some URL" | |
/> | |
// <a href="https://some.url.com">Link to another URL</a> | |
<SpecialLink | |
url="https://another.url.com" | |
label="Link to another URL" | |
target="_blank" | |
rel="external" | |
/> | |
/* | |
<a | |
href="https://another.url.com" | |
target="_blank" | |
rel="external" | |
> | |
Link to some URL | |
</a> | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment