Conform more of the codebase to strictNullChecks
(#10358
* Conform more of the codebase to `strictNullChecks` * Fix types * Iterate * Iterate
This commit is contained in:
parent
41d88ad6ae
commit
503df62191
76 changed files with 323 additions and 327 deletions
|
@ -69,7 +69,7 @@ export default class DialogButtons extends React.Component<IProps> {
|
|||
};
|
||||
|
||||
private onCancelClick = (event: React.MouseEvent): void => {
|
||||
this.props.onCancel(event);
|
||||
this.props.onCancel?.(event);
|
||||
};
|
||||
|
||||
public render(): React.ReactNode {
|
||||
|
@ -77,9 +77,9 @@ export default class DialogButtons extends React.Component<IProps> {
|
|||
if (this.props.primaryButtonClass) {
|
||||
primaryButtonClassName += " " + this.props.primaryButtonClass;
|
||||
}
|
||||
let cancelButton;
|
||||
|
||||
if (this.props.cancelButton || this.props.hasCancel) {
|
||||
let cancelButton: JSX.Element | undefined;
|
||||
if (this.props.hasCancel) {
|
||||
cancelButton = (
|
||||
<button
|
||||
// important: the default type is 'submit' and this button comes before the
|
||||
|
@ -95,7 +95,7 @@ export default class DialogButtons extends React.Component<IProps> {
|
|||
);
|
||||
}
|
||||
|
||||
let additive = null;
|
||||
let additive: JSX.Element | undefined;
|
||||
if (this.props.additive) {
|
||||
additive = <div className="mx_Dialog_buttons_additive">{this.props.additive}</div>;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue