React external link

2 months ago

All parametrs needs to be passed to external link in react application

import React from 'react';

type TProps = {
  href: string;
  title: string;
  children: string;
};

const ExternalLink: React.FC<TProps> = (props) => {
  const { href, title, children } = props;

  return (
    <a
      href={href}
      title={title}
      rel='noopener noreferrer external nofollow'
      target='_blank'
    >
      {children}
    </a>
  );
};

export default ExternalLink;