mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fix error due to async validators for <Input> (#3823)
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
d448017f33
commit
dfa0a35695
@ -91,7 +91,7 @@ const defaultProps: Partial<InputProps> = {
|
||||
export class Input extends React.Component<InputProps, State> {
|
||||
static defaultProps = defaultProps as object;
|
||||
|
||||
public input: InputElement;
|
||||
public input: InputElement | null = null;
|
||||
public validators: InputValidator[] = [];
|
||||
|
||||
public state: State = {
|
||||
@ -191,7 +191,7 @@ export class Input extends React.Component<InputProps, State> {
|
||||
}
|
||||
}
|
||||
|
||||
this.input.setCustomValidity(errors.length ? errors[0].toString() : "");
|
||||
this.input?.setCustomValidity(errors.length ? errors[0].toString() : "");
|
||||
}
|
||||
|
||||
setValidation(errors: React.ReactNode[]) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user