Repository URL to install this package:
Version:
0.9.6 ▾
|
// @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,
// // }
// })