Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
handleClick = e => {
const childOnClick = this.props.children.props.onClick;
if (isFunction(childOnClick)) {
childOnClick(e);
}
if (!e.defaultPrevented && !(e.button == 1 || e.metaKey || e.ctrlKey)) {
e.preventDefault();
let params = this.props.params || {};
let to = this.props.to;
let options = this.getOptions();
this.props.router.stateService.go(to, params, options);
}
};
return () => {
if (isFunction(cleanup.current)) cleanup.current();
};
}, []);