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
@@ -17,7 +17,7 @@ import type { ActionMeta, OptionTypeBase, Props as ReactSelectProps, Styles } fr
import type { CreatableProps } from "react-select/creatable";
import { ThemeStore } from "../../theme.store";
import { boundMethod, cssNames } from "../../utils";
import { autoBind, cssNames } from "../../utils";
const { Menu } = components;
@@ -52,6 +52,7 @@ export class Select extends React.Component<SelectProps> {
constructor(props: SelectProps) {
super(props);
makeObservable(this);
autoBind(this);
}
@computed get themeClass() {
@@ -97,14 +98,12 @@ export class Select extends React.Component<SelectProps> {
return options as SelectOption[];
}
@boundMethod
onChange(value: SelectOption, meta: ActionMeta<any>) {
if (this.props.onChange) {
this.props.onChange(value, meta);
}
}
@boundMethod
onKeyDown(evt: React.KeyboardEvent<HTMLElement>) {
if (this.props.onKeyDown) {
this.props.onKeyDown(evt);