Conform more of the codebase to strictNullChecks (#10607)

* Conform more of the codebase to `strictNullChecks`

* Conform more of the codebase to `strictNullChecks`

* Fix types

* Conform more of the codebase to `strictNullChecks`

* Conform more of the codebase to `strictNullChecks`
This commit is contained in:
Michael Telatynski 2023-04-17 09:25:00 +01:00 committed by GitHub
parent 9d8d610f31
commit 56e4ae41f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 71 additions and 68 deletions

View file

@ -212,9 +212,9 @@ const SpaceCreateMenu: React.FC<{
const [busy, setBusy] = useState<boolean>(false);
const [name, setName] = useState("");
const spaceNameField = useRef<Field>();
const spaceNameField = useRef<Field>(null);
const [alias, setAlias] = useState("");
const spaceAliasField = useRef<RoomAliasField>();
const spaceAliasField = useRef<RoomAliasField>(null);
const [avatar, setAvatar] = useState<File | undefined>(undefined);
const [topic, setTopic] = useState<string>("");

View file

@ -331,9 +331,9 @@ const InnerSpacePanel = React.memo<IInnerSpacePanelProps>(
const SpacePanel: React.FC = () => {
const [isPanelCollapsed, setPanelCollapsed] = useState(true);
const ref = useRef<HTMLDivElement>();
const ref = useRef<HTMLDivElement>(null);
useLayoutEffect(() => {
UIStore.instance.trackElementDimensions("SpacePanel", ref.current);
if (ref.current) UIStore.instance.trackElementDimensions("SpacePanel", ref.current);
return () => UIStore.instance.stopTrackingElementDimensions("SpacePanel");
}, []);