Conform more of the codebase to strictNullChecks
(#10602)
* Conform more of the codebase to `strictNullChecks` * Conform more of the codebase to `strictNullChecks` * Fix types
This commit is contained in:
parent
93858813a3
commit
daad630827
26 changed files with 79 additions and 49 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, RefObject } from "react";
|
||||
import React, { useContext, useRef, useState, MouseEvent, ReactNode } 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() as RefObject<HTMLInputElement>;
|
||||
const uploadRef = useRef<HTMLInputElement>(null);
|
||||
|
||||
const label = hasAvatar || busy ? hasAvatarLabel : noAvatarLabel;
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
|||
limitations under the License.
|
||||
*/
|
||||
|
||||
import React, { RefObject, useCallback, useContext, useRef } from "react";
|
||||
import React, { useCallback, useContext, useRef } from "react";
|
||||
import { Room } from "matrix-js-sdk/src/models/room";
|
||||
import classNames from "classnames";
|
||||
import { EventType } from "matrix-js-sdk/src/@types/event";
|
||||
|
@ -38,7 +38,7 @@ interface IProps extends React.HTMLProps<HTMLDivElement> {
|
|||
|
||||
export default function RoomTopic({ room, ...props }: IProps): JSX.Element {
|
||||
const client = useContext(MatrixClientContext);
|
||||
const ref = useRef() as RefObject<HTMLDivElement>;
|
||||
const ref = useRef<HTMLDivElement>(null);
|
||||
|
||||
const topic = useTopic(room);
|
||||
const body = topicToHtml(topic?.text, topic?.html, ref);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue