Installed react-external-links

This commit is contained in:
Alejandro Celaya
2019-08-29 17:47:18 +02:00
parent 34f194c714
commit 2fe923678e
3 changed files with 8 additions and 18 deletions

View File

@@ -1,19 +1,3 @@
import React from 'react';
import PropTypes from 'prop-types';
import { ExternalLink } from 'react-external-link';
const propTypes = {
href: PropTypes.string.isRequired,
children: PropTypes.node,
};
export default function ExternalLink(props) {
const { href, children, ...rest } = props;
return (
<a target="_blank" rel="noopener noreferrer" href={href} {...rest}>
{children || href}
</a>
);
}
ExternalLink.propTypes = propTypes;
export default ExternalLink;