mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Removed package "autobind-decorator" and @boundMethod in favour of "auto-bind" util for constructors-only. (#5218)
This commit is contained in:
1 parent
5f145e69e5
commit
06e7dfce5e
45 files changed
+150
-180
No files matched your search
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user