Conform more of the code base to strict null checking (#10147)

* Conform more of the code base to strict null checking

* More strict fixes

* More strict work

* Fix missing optional type

* Iterate
This commit is contained in:
Michael Telatynski 2023-02-13 17:01:43 +00:00 committed by GitHub
parent fa036a5080
commit da7aa4055e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
380 changed files with 682 additions and 694 deletions

View file

@ -118,7 +118,7 @@ export default class AudioFeed extends React.Component<IProps, IState> {
this.playMedia();
};
public render(): JSX.Element {
public render(): React.ReactNode {
// Do not render the audio element if there is no audio track
if (this.state.audioMuted) return null;

View file

@ -39,7 +39,7 @@ class DialPadButton extends React.PureComponent<IButtonProps> {
this.props.onButtonPress(this.props.digit, ev);
};
public render(): JSX.Element {
public render(): React.ReactNode {
switch (this.props.kind) {
case DialPadButtonKind.Digit:
return (
@ -68,7 +68,7 @@ interface IProps {
}
export default class Dialpad extends React.PureComponent<IProps> {
public render(): JSX.Element {
public render(): React.ReactNode {
const buttonNodes = [];
for (let i = 0; i < BUTTONS.length; i++) {

View file

@ -82,7 +82,7 @@ export default class DialpadModal extends React.PureComponent<IProps, IState> {
this.props.onFinished(true);
};
public render(): JSX.Element {
public render(): React.ReactNode {
const backspaceButton = <DialPadBackspaceButton onBackspacePress={this.onDeletePress} />;
// Only show the backspace button if the field has content

View file

@ -549,7 +549,7 @@ export default class LegacyCallView extends React.Component<IProps, IState> {
}
}
public render(): JSX.Element {
public render(): React.ReactNode {
const { call, secondaryCall, pipMode, showApps, onMouseDownOnHeader } = this.props;
const { sidebarShown, sidebarFeeds } = this.state;

View file

@ -217,7 +217,7 @@ export default class LegacyCallViewButtons extends React.Component<IProps, IStat
this.setState({ showMoreMenu: false });
};
public render(): JSX.Element {
public render(): React.ReactNode {
const callControlsClasses = classNames("mx_LegacyCallViewButtons", {
mx_LegacyCallViewButtons_hidden: !this.state.visible,
});

View file

@ -83,7 +83,7 @@ export default class LegacyCallViewForRoom extends React.Component<IProps, IStat
this.props.resizeNotifier.stopResizing();
};
public render(): JSX.Element {
public render(): React.ReactNode {
if (!this.state.call) return null;
return (

View file

@ -28,7 +28,7 @@ interface IProps {
}
export default class LegacyCallViewSidebar extends React.Component<IProps> {
public render(): JSX.Element {
public render(): React.ReactNode {
const feeds = this.props.feeds.map((feed) => {
return (
<VideoFeed

View file

@ -177,7 +177,7 @@ export default class VideoFeed extends React.PureComponent<IProps, IState> {
}
};
public render(): JSX.Element {
public render(): React.ReactNode {
const { pipMode, primary, secondary, feed } = this.props;
const wrapperClasses = classnames("mx_VideoFeed", {