Conform more of the codebase to strictNullChecks
(#10731)
This commit is contained in:
parent
9f8113eabd
commit
1281c0746b
40 changed files with 147 additions and 119 deletions
|
@ -62,7 +62,7 @@ export default class SearchBox extends React.Component<IProps, IState> {
|
|||
|
||||
private onSearch = throttle(
|
||||
(): void => {
|
||||
this.props.onSearch(this.search.current?.value);
|
||||
this.props.onSearch(this.search.current?.value ?? "");
|
||||
},
|
||||
200,
|
||||
{ trailing: true, leading: true },
|
||||
|
@ -94,11 +94,9 @@ export default class SearchBox extends React.Component<IProps, IState> {
|
|||
};
|
||||
|
||||
private clearSearch(source?: string): void {
|
||||
this.search.current.value = "";
|
||||
if (this.search.current) this.search.current.value = "";
|
||||
this.onChange();
|
||||
if (this.props.onCleared) {
|
||||
this.props.onCleared(source);
|
||||
}
|
||||
this.props.onCleared?.(source);
|
||||
}
|
||||
|
||||
public render(): React.ReactNode {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue