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

@@ -11,7 +11,7 @@ import React from "react";
import { Icon } from "../icon";
import type { InputProps, InputValidator } from "../input";
import { Input } from "../input";
import { boundMethod } from "../../utils";
import { autoBind } from "../../utils";
export interface EditableListProps<T> {
items: T[];
@@ -36,7 +36,11 @@ const defaultProps: Partial<EditableListProps<any>> = {
export class EditableList<T> extends React.Component<EditableListProps<T>> {
static defaultProps = defaultProps as EditableListProps<any>;
@boundMethod
constructor(props: EditableListProps<T>) {
super(props);
autoBind(this);
}
onSubmit(val: string, evt: React.KeyboardEvent) {
if (val) {
evt.preventDefault();