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

@@ -5,7 +5,7 @@
import "./checkbox.scss";
import React from "react";
import { boundMethod, cssNames } from "../../utils";
import { cssNames } from "../../utils";
export interface CheckboxProps<T = boolean> {
className?: string;
@@ -19,12 +19,11 @@ export interface CheckboxProps<T = boolean> {
export class Checkbox extends React.PureComponent<CheckboxProps> {
private input: HTMLInputElement;
@boundMethod
onChange(evt: React.ChangeEvent<HTMLInputElement>) {
onChange = (evt: React.ChangeEvent<HTMLInputElement>) => {
if (this.props.onChange) {
this.props.onChange(this.input.checked, evt);
}
}
};
getValue() {
if (this.props.value !== undefined) return this.props.value;