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:
parent
cefd94859c
commit
a47b3eb0ee
24 changed files with 158 additions and 121 deletions
|
@ -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)}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue