Apply strictNullChecks to src/components/views/elements/* (#10462

* Apply `strictNullChecks` to `src/components/views/elements/*`

* Iterate

* Iterate

* Iterate

* Apply `strictNullChecks` to `src/components/views/elements/*`

* Iterate

* Iterate

* Iterate

* Update snapshot
This commit is contained in:
Michael Telatynski 2023-03-29 08:23:54 +01:00 committed by GitHub
parent cefd94859c
commit a47b3eb0ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 158 additions and 121 deletions

View file

@ -16,7 +16,7 @@ limitations under the License.
import classNames from "classnames";
import { EventType } from "matrix-js-sdk/src/@types/event";
import React, { useContext, useRef, useState, MouseEvent, ReactNode } from "react";
import React, { useContext, useRef, useState, MouseEvent, ReactNode, RefObject } from "react";
import MatrixClientContext from "../../../contexts/MatrixClientContext";
import RoomContext from "../../../contexts/RoomContext";
@ -59,7 +59,7 @@ const MiniAvatarUploader: React.FC<IProps> = ({
setShow(false);
}, 13000); // hide after being shown for 10 seconds
const uploadRef = useRef<HTMLInputElement>();
const uploadRef = useRef() as RefObject<HTMLInputElement>;
const label = hasAvatar || busy ? hasAvatarLabel : noAvatarLabel;
@ -97,7 +97,7 @@ const MiniAvatarUploader: React.FC<IProps> = ({
})}
disabled={busy}
onClick={() => {
uploadRef.current.click();
uploadRef.current?.click();
}}
onMouseOver={() => setHover(true)}
onMouseLeave={() => setHover(false)}