import React, { Component, PropTypes } from 'react';

class ExternalLink extends Component {
  static propTypes = {
    className: PropTypes.string,
    href: PropTypes.string.isRequired,
    children: PropTypes.any.isRequired
  };

  render() {
    return (
      <a className={ this.props.className }
        href={ this.props.href }
        rel={ "noreferrer noopener" }
        target={ "_blank" }>
        { this.props.children }
      </a>
    );
  }
}

export default ExternalLink;

@@ -223,13 +223,1567 @@
 ired
+,%0A    target: PropTypes.string%0A  %7D;%0A%0A  trackClick(callback) %7B%0A    if (typeof ga != 'undefined') %7B%0A      let fieldObject = %7B%0A        hitType: 'event',%0A        eventCategory: 'Outbound',%0A        eventAction: 'Click',%0A        eventLabel: this.props.href%0A      %7D;%0A      if ( callback ) %7B%0A        // https://github.com/react-ga/react-ga/blob/master/src/index.js#L454%0A        var safetyCallbackCalled = false;%0A        var safetyCallback = function () %7B%0A          safetyCallbackCalled = true;%0A          callback();%0A        %7D;%0A        var t = setTimeout(safetyCallback, 250);%0A        var clearableCallbackForGA = function () %7B%0A          clearTimeout(t);%0A          if (!safetyCallbackCalled) %7B%0A            callback();%0A          %7D%0A        %7D;%0A        fieldObject.hitCallback = clearableCallbackForGA;%0A      %7D%0A      ga('send', fieldObject);%0A    %7D%0A  %7D%0A%0A  onLinkClick(e) %7B%0A    e.preventDefault();%0A    var normalClick = !( //https://github.com/react-ga/react-ga/pull/91/files%0A      e.ctrlKey %7C%7C%0A      e.shiftKey %7C%7C%0A      e.metaKey %7C%7C%0A      e.button === 1%0A    );%0A    if ( this.props.target !== %22_blank%22 && normalClick ) %7B%0A      this.trackClick(() =%3E %7B%0A        window.location.href = this.props.href;%0A      %7D);%0A    %7D else %7B%0A      this.trackClick();%0A      // https://mathiasbynens.github.io/rel-noopener/%0A      // TODO use iFrame method to securely open in Safari%0A      // https://github.com/danielstjules/blankshield/blob/master/blankshield.js#L161%0A      var otherWindow = window.open();%0A      otherWindow.opener = null;%0A      otherWindow.location = this.props.href;%0A    %7D
 %0A  %7D
-;
 %0A%0A  
@@ -1895,63 +1895,46 @@
     
-rel=%7B %22noreferrer noopener%22 %7D%0A        target=%7B %22_blank%22
+onClick=%7B (e) =%3E %7Bthis.onLinkClick(e)%7D
  %7D%3E%0A

Update external link component