src/index.js
function Link(props) {

  // Handle clicks of the link
  const onClick = e => {
    e.preventDefault();
    routeTo(path);
  };

  // If link is for a new tab
  if(props.openIn === 'new') {
    return (
      <a href={props.to} target="_blank" rel="noopener noreferrer">
        {props.children}
      </a>
    );
  }

  return (
    <a href={props.to} onClick={onClick}>
      {props.children}
    </a>
  );
}
function Link(props) {

  // Handle clicks of the link
  const onClick = e => {
    e.preventDefault();
    routeTo(path);
  };

  // If link is for a new tab
  if(props.openIn === 'new') {
    return (
      <a href={props.to} target="_blank" rel="noopener noreferrer">
        {props.children}
      </a>
    );
  }

  return (
    <a href={props.to} onClick={onClick}>
      {props.children}
    </a>
  );
}
function Link ( props ) { // Handle clicks of the link const onClick = e => { e . preventDefault ( ) ; routeTo ( path ) ; } ; // If link is for a new tab if ( props . openIn === 'new' ) { return ( < a href = { props . to } target = "_blank" rel = "noopener noreferrer" > { props . children } < / a > ) ; } return ( < a href = { props . to } onClick = { onClick } > { props . children } < / a > ) ; }
Create the Link component
Create the Link component