Conform more of the codebase to strictNullChecks (#10358

* Conform more of the codebase to `strictNullChecks`

* Fix types

* Iterate

* Iterate
This commit is contained in:
Michael Telatynski 2023-03-13 15:07:20 +00:00 committed by GitHub
parent 41d88ad6ae
commit 503df62191
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
76 changed files with 323 additions and 327 deletions

View file

@ -113,8 +113,8 @@ interface IState {
*/
export default class Dropdown extends React.Component<DropdownProps, IState> {
private readonly buttonRef = createRef<HTMLDivElement>();
private dropdownRootElement: HTMLDivElement = null;
private ignoreEvent: MouseEvent = null;
private dropdownRootElement: HTMLDivElement | null = null;
private ignoreEvent: MouseEvent | null = null;
private childrenByKey: Record<string, ReactNode> = {};
public constructor(props: DropdownProps) {
@ -373,18 +373,14 @@ export default class Dropdown extends React.Component<DropdownProps, IState> {
);
}
const dropdownClasses: Record<string, boolean> = {
mx_Dropdown: true,
mx_Dropdown_disabled: this.props.disabled,
};
if (this.props.className) {
dropdownClasses[this.props.className] = true;
}
const dropdownClasses = classnames("mx_Dropdown", this.props.className, {
mx_Dropdown_disabled: !!this.props.disabled,
});
// Note the menu sits inside the AccessibleButton div so it's anchored
// to the input, but overflows below it. The root contains both.
return (
<div className={classnames(dropdownClasses)} ref={this.collectRoot}>
<div className={dropdownClasses} ref={this.collectRoot}>
<AccessibleButton
className="mx_Dropdown_input mx_no_textinput"
onClick={this.onAccessibleButtonClick}