Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
ui-component-library / src / components / atoms / Link / renderProps.ddd
Size: Mime:

// @todo https://github.com/ReactTraining/react-router/blob/master/packages/react-router-dom/modules/Link.js#L67
handleClick = event => {
  if (this.props.onClick) this.props.onClick(event);

  if (
    !event.defaultPrevented && // onClick prevented default
    event.button === 0 && // ignore everything but left clicks
    !this.props.target && // let browser handle "target=_blank" etc.
    !isModifiedEvent(event) // ignore clicks with modifier keys
  ) {
    event.preventDefault();

    const { history } = this.context.router;
    const { replace, to } = this.props;

    if (replace) {
      history.replace(to);
    } else {
      history.push(to);
    }
  }
};


  // .add('ReactRouter', () => {
  //   const isValueExternal = to => to.includes('http') || to.includes('mailto') || to.includes('tel')
  //   //  attributes.to = {
  //   //   pathname: to,
  //   // }
  // })