Removed package "autobind-decorator" and @boundMethod in favour of "auto-bind" util for constructors-only. (#5218)

This commit is contained in:
Roman authored and GitHub committed 2022-04-07 17:21:54 +03:00
1 parent 5f145e69e5
commit 06e7dfce5e
45 files changed
+150 -180

No files matched your search

+2 -3
View File
@@ -11,7 +11,7 @@ import { observer } from "mobx-react";
import { cssNames } from "../../utils/cssNames";
import type { TooltipDecoratorProps } from "../tooltip";
import { withTooltip } from "../tooltip";
import { boundMethod } from "../../utils";
import { autoBind } from "../../utils";
export interface BadgeProps extends React.HTMLAttributes<any>, TooltipDecoratorProps {
small?: boolean;
@@ -44,6 +44,7 @@ export class Badge extends React.Component<BadgeProps> {
constructor(props: BadgeProps) {
super(props);
makeObservable(this);
autoBind(this);
}
@computed get isExpandable() {
@@ -52,7 +53,6 @@ export class Badge extends React.Component<BadgeProps> {
return this.elem?.clientWidth < this.elem?.scrollWidth;
}
@boundMethod
onMouseUp() {
if (!this.isExpandable || Badge.badgeMeta.hasTextSelected) {
Badge.badgeMeta.hasTextSelected = false;
@@ -61,7 +61,6 @@ export class Badge extends React.Component<BadgeProps> {
}
}
@boundMethod
bindRef(elem: HTMLElement) {
this.elem = elem;
}