Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

boring-router-react

Package Overview
Dependencies
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

boring-router-react - npm Package Compare versions

Comparing version 0.3.0-alpha.40 to 0.3.0-alpha.43

5

bld/library/link.d.ts

@@ -13,8 +13,5 @@ import { RouteMatch, RouteMatchSharedToParamDict } from 'boring-router';

export declare class Link<TRouteMatch extends RouteMatch> extends Component<LinkProps<TRouteMatch>> {
private href;
private readonly href;
render(): ReactNode;
private onMouseEnter;
private onFocus;
private onClick;
private updateHref;
}

28

bld/library/link.js

@@ -11,9 +11,2 @@ "use strict";

super(...arguments);
this.href = 'javascript:;';
this.onMouseEnter = () => {
this.updateHref();
};
this.onFocus = () => {
this.updateHref();
};
this.onClick = (event) => {

@@ -38,22 +31,19 @@ if (event.ctrlKey ||

}
render() {
let _a = this.props, { className, to, params, replace, toggle, onMouseEnter, onFocus, onClick } = _a, props = tslib_1.__rest(_a, ["className", "to", "params", "replace", "toggle", "onMouseEnter", "onFocus", "onClick"]);
return (react_1.default.createElement("a", Object.assign({ className: className, href: this.href, onMouseEnter: _utils_1.composeEventHandler([onMouseEnter, this.onMouseEnter]), onFocus: _utils_1.composeEventHandler([onFocus, this.onFocus]), onClick: _utils_1.composeEventHandler([onClick, this.onClick], true) }, props)));
}
updateHref() {
get href() {
let { to, params } = this.props;
try {
this.href = to.$router.$(to, params).$href();
return to.$router.$(to, params).$href();
}
catch (error) {
this.href = 'javascript:;';
return '#';
}
}
render() {
let _a = this.props, { className, to, params, replace, toggle, onClick } = _a, props = tslib_1.__rest(_a, ["className", "to", "params", "replace", "toggle", "onClick"]);
return (react_1.default.createElement("a", Object.assign({ className: className, href: this.href, onClick: _utils_1.composeEventHandler([onClick, this.onClick], true) }, props)));
}
};
tslib_1.__decorate([
mobx_1.observable
], Link.prototype, "href", void 0);
tslib_1.__decorate([
mobx_1.action
], Link.prototype, "updateHref", null);
mobx_1.computed
], Link.prototype, "href", null);
Link = tslib_1.__decorate([

@@ -60,0 +50,0 @@ mobx_react_1.observer

{
"name": "boring-router-react",
"version": "0.3.0-alpha.40",
"version": "0.3.0-alpha.43",
"description": "A light-weight, type-safe, yet reactive router service using MobX.",

@@ -41,3 +41,3 @@ "repository": {

},
"gitHead": "5354f854cb8251db35639c1aea5dca6284bcf61d"
"gitHead": "ec1c0ef3bf5fb384d5c4781e5873a34c7ce780fd"
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc