diff --git a/src/AsyncWrapper.tsx b/src/AsyncWrapper.tsx index 9d0ba11b06..e4e12bedfe 100644 --- a/src/AsyncWrapper.tsx +++ b/src/AsyncWrapper.tsx @@ -74,7 +74,7 @@ export default class AsyncWrapper extends React.Component { this.props.onFinished(false); }; - public render(): JSX.Element { + public render(): React.ReactNode { if (this.state.component) { const Component = this.state.component; return ; diff --git a/src/Avatar.ts b/src/Avatar.ts index 986ae6306a..391495030c 100644 --- a/src/Avatar.ts +++ b/src/Avatar.ts @@ -138,7 +138,7 @@ export function getInitialLetter(name: string): string | undefined { } export function avatarUrlForRoom( - room: Room, + room: Room | null, width: number, height: number, resizeMethod?: ResizeMethod, diff --git a/src/HtmlUtils.tsx b/src/HtmlUtils.tsx index a6b999fa27..e8b38d50c5 100644 --- a/src/HtmlUtils.tsx +++ b/src/HtmlUtils.tsx @@ -204,7 +204,7 @@ const transformTags: IExtendedSanitizeOptions["transformTags"] = { attribs.style += "height: 100%;"; } - attribs.src = mediaFromMxc(src).getThumbnailOfSourceHttp(width, height); + attribs.src = mediaFromMxc(src).getThumbnailOfSourceHttp(width, height)!; return { tagName, attribs }; }, "code": function (tagName: string, attribs: sanitizeHtml.Attributes) { @@ -352,7 +352,7 @@ const topicSanitizeHtmlParams: IExtendedSanitizeOptions = { }; abstract class BaseHighlighter { - public constructor(public highlightClass: string, public highlightLink: string) {} + public constructor(public highlightClass: string, public highlightLink?: string) {} /** * apply the highlights to a section of text @@ -504,7 +504,7 @@ function formatEmojis(message: string, isHtmlMessage: boolean): (JSX.Element | s export function bodyToHtml(content: IContent, highlights: Optional, opts: IOptsReturnString): string; export function bodyToHtml(content: IContent, highlights: Optional, opts: IOptsReturnNode): ReactNode; export function bodyToHtml(content: IContent, highlights: Optional, opts: IOpts = {}): ReactNode | string { - const isFormattedBody = content.format === "org.matrix.custom.html" && !!content.formatted_body; + const isFormattedBody = content.format === "org.matrix.custom.html" && typeof content.formatted_body === "string"; let bodyHasEmoji = false; let isHtmlMessage = false; @@ -514,7 +514,7 @@ export function bodyToHtml(content: IContent, highlights: Optional, op } let strippedBody: string; - let safeBody: string; // safe, sanitised HTML, preferred over `strippedBody` which is fully plaintext + let safeBody: string | undefined; // safe, sanitised HTML, preferred over `strippedBody` which is fully plaintext try { // sanitizeHtml can hang if an unclosed HTML tag is thrown at it @@ -529,7 +529,7 @@ export function bodyToHtml(content: IContent, highlights: Optional, op if (opts.stripReplyFallback && formattedBody) formattedBody = stripHTMLReply(formattedBody); strippedBody = opts.stripReplyFallback ? stripPlainReply(plainBody) : plainBody; - bodyHasEmoji = mightContainEmoji(isFormattedBody ? formattedBody : plainBody); + bodyHasEmoji = mightContainEmoji(isFormattedBody ? formattedBody! : plainBody); const highlighter = safeHighlights?.length ? new HtmlHighlighter("mx_EventTile_searchHighlight", opts.highlightLink) @@ -543,11 +543,11 @@ export function bodyToHtml(content: IContent, highlights: Optional, op // by an attempt to search for 'foobar'. Then again, the search query probably wouldn't work either // XXX: hacky bodge to temporarily apply a textFilter to the sanitizeParams structure. sanitizeParams.textFilter = function (safeText) { - return highlighter.applyHighlights(safeText, safeHighlights).join(""); + return highlighter.applyHighlights(safeText, safeHighlights!).join(""); }; } - safeBody = sanitizeHtml(formattedBody, sanitizeParams); + safeBody = sanitizeHtml(formattedBody!, sanitizeParams); const phtml = cheerio.load(safeBody, { // @ts-ignore: The `_useHtmlParser2` internal option is the // simplest way to both parse and render using `htmlparser2`. @@ -574,7 +574,7 @@ export function bodyToHtml(content: IContent, highlights: Optional, op safeBody = formatEmojis(safeBody, true).join(""); } } else if (highlighter) { - safeBody = highlighter.applyHighlights(plainBody, safeHighlights).join(""); + safeBody = highlighter.applyHighlights(plainBody, safeHighlights!).join(""); } } finally { delete sanitizeParams.textFilter; @@ -597,9 +597,7 @@ export function bodyToHtml(content: IContent, highlights: Optional, op const match = BIGEMOJI_REGEX.exec(contentBodyTrimmed); emojiBody = - match && - match[0] && - match[0].length === contentBodyTrimmed.length && + match?.[0]?.length === contentBodyTrimmed.length && // Prevent user pills expanding for users with only emoji in // their username. Permalinks (links in pills) can be any URL // now, so we just check for an HTTP-looking thing. @@ -614,7 +612,7 @@ export function bodyToHtml(content: IContent, highlights: Optional, op "markdown-body": isHtmlMessage && !emojiBody, }); - let emojiBodyElements: JSX.Element[]; + let emojiBodyElements: JSX.Element[] | undefined; if (!safeBody && bodyHasEmoji) { emojiBodyElements = formatEmojis(strippedBody, false) as JSX.Element[]; } @@ -649,7 +647,7 @@ export function topicToHtml( allowExtendedHtml = false, ): ReactNode { if (!SettingsStore.getValue("feature_html_topic")) { - htmlTopic = null; + htmlTopic = undefined; } let isFormattedTopic = !!htmlTopic; @@ -657,10 +655,10 @@ export function topicToHtml( let safeTopic = ""; try { - topicHasEmoji = mightContainEmoji(isFormattedTopic ? htmlTopic : topic); + topicHasEmoji = mightContainEmoji(isFormattedTopic ? htmlTopic! : topic); if (isFormattedTopic) { - safeTopic = sanitizeHtml(htmlTopic, allowExtendedHtml ? sanitizeHtmlParams : topicSanitizeHtmlParams); + safeTopic = sanitizeHtml(htmlTopic!, allowExtendedHtml ? sanitizeHtmlParams : topicSanitizeHtmlParams); if (topicHasEmoji) { safeTopic = formatEmojis(safeTopic, true).join(""); } @@ -669,7 +667,7 @@ export function topicToHtml( isFormattedTopic = false; // Fall back to plain-text topic } - let emojiBodyElements: ReturnType; + let emojiBodyElements: ReturnType | undefined; if (!isFormattedTopic && topicHasEmoji) { emojiBodyElements = formatEmojis(topic, false); } diff --git a/src/Markdown.ts b/src/Markdown.ts index a32126117d..89cfcf65fe 100644 --- a/src/Markdown.ts +++ b/src/Markdown.ts @@ -139,7 +139,7 @@ export default class Markdown { */ private repairLinks(parsed: commonmark.Node): commonmark.Node { const walker = parsed.walker(); - let event: commonmark.NodeWalkingStep = null; + let event: commonmark.NodeWalkingStep | null = null; let text = ""; let isInPara = false; let previousNode: commonmark.Node | null = null; @@ -287,7 +287,7 @@ export default class Markdown { // However, if it's a blockquote, adds a p tag anyway // in order to avoid deviation to commonmark and unexpected // results when parsing the formatted HTML. - if (node.parent.type === "block_quote" || isMultiLine(node)) { + if (node.parent?.type === "block_quote" || isMultiLine(node)) { realParagraph.call(this, node, entering); } }; diff --git a/src/NodeAnimator.tsx b/src/NodeAnimator.tsx index be2a3442e9..b8c3f855ac 100644 --- a/src/NodeAnimator.tsx +++ b/src/NodeAnimator.tsx @@ -120,7 +120,7 @@ export default class NodeAnimator extends React.Component { this.nodes[k] = node; } - public render(): JSX.Element { + public render(): React.ReactNode { return <>{Object.values(this.children)}; } } diff --git a/src/PosthogTrackers.ts b/src/PosthogTrackers.ts index 8a8b02965c..a82b78c1dd 100644 --- a/src/PosthogTrackers.ts +++ b/src/PosthogTrackers.ts @@ -120,7 +120,7 @@ export class PosthogScreenTracker extends PureComponent<{ screenName: ScreenName PosthogTrackers.instance.clearOverride(this.props.screenName); } - public render(): JSX.Element { + public render(): React.ReactNode { return null; // no need to render anything, we just need to hook into the React lifecycle } } diff --git a/src/Presence.ts b/src/Presence.ts index c13cc32b60..02d2ef0e7e 100644 --- a/src/Presence.ts +++ b/src/Presence.ts @@ -33,9 +33,9 @@ enum State { } class Presence { - private unavailableTimer: Timer = null; - private dispatcherRef: string = null; - private state: State = null; + private unavailableTimer: Timer | null = null; + private dispatcherRef: string | null = null; + private state: State | null = null; /** * Start listening the user activity to evaluate his presence state. @@ -73,14 +73,14 @@ class Presence { * Get the current presence state. * @returns {string} the presence state (see PRESENCE enum) */ - public getState(): State { + public getState(): State | null { return this.state; } private onAction = (payload: ActionPayload): void => { if (payload.action === "user_activity") { this.setState(State.Online); - this.unavailableTimer.restart(); + this.unavailableTimer?.restart(); } }; diff --git a/src/Resend.ts b/src/Resend.ts index bc62c62efa..17e39a7e29 100644 --- a/src/Resend.ts +++ b/src/Resend.ts @@ -46,7 +46,7 @@ export default class Resend { } public static resend(event: MatrixEvent): Promise { - const room = MatrixClientPeg.get().getRoom(event.getRoomId()); + const room = MatrixClientPeg.get().getRoom(event.getRoomId())!; return MatrixClientPeg.get() .resendEvent(event, room) .then( diff --git a/src/RoomAliasCache.ts b/src/RoomAliasCache.ts index c318db2d3f..f565d8d2d3 100644 --- a/src/RoomAliasCache.ts +++ b/src/RoomAliasCache.ts @@ -30,6 +30,6 @@ export function storeRoomAliasInCache(alias: string, id: string): void { aliasToIDMap.set(alias, id); } -export function getCachedRoomIDForAlias(alias: string): string { +export function getCachedRoomIDForAlias(alias: string): string | undefined { return aliasToIDMap.get(alias); } diff --git a/src/RoomInvite.tsx b/src/RoomInvite.tsx index 582eb360f8..246e9e5a37 100644 --- a/src/RoomInvite.tsx +++ b/src/RoomInvite.tsx @@ -112,7 +112,7 @@ export function inviteUsersToRoom( ): Promise { return inviteMultipleToRoom(roomId, userIds, sendSharedHistoryKeys, progressCallback) .then((result) => { - const room = MatrixClientPeg.get().getRoom(roomId); + const room = MatrixClientPeg.get().getRoom(roomId)!; showAnyInviteErrors(result.states, room, result.inviter); }) .catch((err) => { @@ -175,14 +175,14 @@ export function showAnyInviteErrors(
{name} - {user.userId} + {user?.userId}
{inviter.getErrorText(addr)} diff --git a/src/RoomNotifs.ts b/src/RoomNotifs.ts index c29105b780..aa0d89df79 100644 --- a/src/RoomNotifs.ts +++ b/src/RoomNotifs.ts @@ -46,7 +46,7 @@ export function getRoomNotifsState(client: MatrixClient, roomId: string): RoomNo } // for everything else, look at the room rule. - let roomRule = null; + let roomRule: IPushRule | undefined; try { roomRule = client.getRoomPushRule("global", roomId); } catch (err) { @@ -106,7 +106,7 @@ export function getUnreadNotificationCount(room: Room, type: NotificationCountTy function setRoomNotifsStateMuted(roomId: string): Promise { const cli = MatrixClientPeg.get(); - const promises = []; + const promises: Promise[] = []; // delete the room rule const roomRule = cli.getRoomPushRule("global", roomId); @@ -137,7 +137,7 @@ function setRoomNotifsStateMuted(roomId: string): Promise { function setRoomNotifsStateUnmuted(roomId: string, newState: RoomNotifState): Promise { const cli = MatrixClientPeg.get(); - const promises = []; + const promises: Promise[] = []; const overrideMuteRule = findOverrideMuteRule(roomId); if (overrideMuteRule) { diff --git a/src/Rooms.ts b/src/Rooms.ts index 8d10f121af..250f385206 100644 --- a/src/Rooms.ts +++ b/src/Rooms.ts @@ -29,13 +29,13 @@ import AliasCustomisations from "./customisations/Alias"; * @param {Object} room The room object * @returns {string} A display alias for the given room */ -export function getDisplayAliasForRoom(room: Room): string | undefined { +export function getDisplayAliasForRoom(room: Room): string | null { return getDisplayAliasForAliasSet(room.getCanonicalAlias(), room.getAltAliases()); } // The various display alias getters should all feed through this one path so // there's a single place to change the logic. -export function getDisplayAliasForAliasSet(canonicalAlias: string, altAliases: string[]): string { +export function getDisplayAliasForAliasSet(canonicalAlias: string | null, altAliases: string[]): string | null { if (AliasCustomisations.getDisplayAliasForAliasSet) { return AliasCustomisations.getDisplayAliasForAliasSet(canonicalAlias, altAliases); } @@ -45,7 +45,7 @@ export function getDisplayAliasForAliasSet(canonicalAlias: string, altAliases: s export function guessAndSetDMRoom(room: Room, isDirect: boolean): Promise { let newTarget; if (isDirect) { - const guessedUserId = guessDMRoomTargetId(room, MatrixClientPeg.get().getUserId()); + const guessedUserId = guessDMRoomTargetId(room, MatrixClientPeg.get().getUserId()!); newTarget = guessedUserId; } else { newTarget = null; @@ -118,7 +118,7 @@ function guessDMRoomTargetId(room: Room, myUserId: string): string { if (oldestTs === undefined || (user.events.member && user.events.member.getTs() < oldestTs)) { oldestUser = user; - oldestTs = user.events.member.getTs(); + oldestTs = user.events.member?.getTs(); } } if (oldestUser) return oldestUser.userId; @@ -129,7 +129,7 @@ function guessDMRoomTargetId(room: Room, myUserId: string): string { if (oldestTs === undefined || (user.events.member && user.events.member.getTs() < oldestTs)) { oldestUser = user; - oldestTs = user.events.member.getTs(); + oldestTs = user.events.member?.getTs(); } } diff --git a/src/VoipUserMapper.ts b/src/VoipUserMapper.ts index ae5170d6e4..0214ab9cbe 100644 --- a/src/VoipUserMapper.ts +++ b/src/VoipUserMapper.ts @@ -72,9 +72,9 @@ export default class VoipUserMapper { * Gets the ID of the virtual room for a room, or null if the room has no * virtual room */ - public async getVirtualRoomForRoom(roomId: string): Promise { + public async getVirtualRoomForRoom(roomId: string): Promise { const virtualUser = await this.getVirtualUserForRoom(roomId); - if (!virtualUser) return null; + if (!virtualUser) return undefined; return findDMForUser(MatrixClientPeg.get(), virtualUser); } @@ -145,11 +145,11 @@ export default class VoipUserMapper { // (possibly we should only join if we've also joined the native room, then we'd also have // to make sure we joined virtual rooms on joining a native one) MatrixClientPeg.get().joinRoom(invitedRoom.roomId); - } - // also put this room in the virtual room ID cache so isVirtualRoom return the right answer - // in however long it takes for the echo of setAccountData to come down the sync - this.virtualToNativeRoomIdCache.set(invitedRoom.roomId, nativeRoom.roomId); + // also put this room in the virtual room ID cache so isVirtualRoom return the right answer + // in however long it takes for the echo of setAccountData to come down the sync + this.virtualToNativeRoomIdCache.set(invitedRoom.roomId, nativeRoom.roomId); + } } } } diff --git a/src/async-components/views/dialogs/eventindex/ManageEventIndexDialog.tsx b/src/async-components/views/dialogs/eventindex/ManageEventIndexDialog.tsx index f93e097a9d..5393ae3fc6 100644 --- a/src/async-components/views/dialogs/eventindex/ManageEventIndexDialog.tsx +++ b/src/async-components/views/dialogs/eventindex/ManageEventIndexDialog.tsx @@ -143,7 +143,7 @@ export default class ManageEventIndexDialog extends React.Component } as Pick); }; - public render(): JSX.Element { + public render(): React.ReactNode { const disableForm = this.state.phase === Phase.Exporting; return ( diff --git a/src/async-components/views/dialogs/security/ImportE2eKeysDialog.tsx b/src/async-components/views/dialogs/security/ImportE2eKeysDialog.tsx index e49c090a75..5d3864e811 100644 --- a/src/async-components/views/dialogs/security/ImportE2eKeysDialog.tsx +++ b/src/async-components/views/dialogs/security/ImportE2eKeysDialog.tsx @@ -127,7 +127,7 @@ export default class ImportE2eKeysDialog extends React.Component return false; }; - public render(): JSX.Element { + public render(): React.ReactNode { const disableForm = this.state.phase !== Phase.Edit; return ( diff --git a/src/async-components/views/dialogs/security/NewRecoveryMethodDialog.tsx b/src/async-components/views/dialogs/security/NewRecoveryMethodDialog.tsx index fbe94cb8e6..fbb823dd8e 100644 --- a/src/async-components/views/dialogs/security/NewRecoveryMethodDialog.tsx +++ b/src/async-components/views/dialogs/security/NewRecoveryMethodDialog.tsx @@ -48,13 +48,13 @@ export default class NewRecoveryMethodDialog extends React.PureComponent { onFinished: this.props.onFinished, }, - null, + undefined, /* priority = */ false, /* static = */ true, ); }; - public render(): JSX.Element { + public render(): React.ReactNode { const title = {_t("New Recovery Method")}; const newMethodDetected =

{_t("A new Security Phrase and key for Secure Messages have been detected.")}

; diff --git a/src/async-components/views/dialogs/security/RecoveryMethodRemovedDialog.tsx b/src/async-components/views/dialogs/security/RecoveryMethodRemovedDialog.tsx index 1a7e79b9d2..f795a3e534 100644 --- a/src/async-components/views/dialogs/security/RecoveryMethodRemovedDialog.tsx +++ b/src/async-components/views/dialogs/security/RecoveryMethodRemovedDialog.tsx @@ -37,14 +37,14 @@ export default class RecoveryMethodRemovedDialog extends React.PureComponent>, - null, + undefined, null, /* priority = */ false, /* static = */ true, ); }; - public render(): JSX.Element { + public render(): React.ReactNode { const title = {_t("Recovery Method Removed")}; return ( diff --git a/src/audio/PlaybackQueue.ts b/src/audio/PlaybackQueue.ts index 0828a3df1d..939d76d0a5 100644 --- a/src/audio/PlaybackQueue.ts +++ b/src/audio/PlaybackQueue.ts @@ -91,7 +91,7 @@ export class PlaybackQueue { public unsortedEnqueue(mxEvent: MatrixEvent, playback: Playback): void { // We don't ever detach our listeners: we expect the Playback to clean up for us - this.playbacks.set(mxEvent.getId(), playback); + this.playbacks.set(mxEvent.getId()!, playback); playback.on(UPDATE_EVENT, (state) => this.onPlaybackStateChange(playback, mxEvent, state)); playback.clockInfo.liveData.onUpdate((clock) => this.onPlaybackClock(playback, mxEvent, clock)); } @@ -99,12 +99,12 @@ export class PlaybackQueue { private onPlaybackStateChange(playback: Playback, mxEvent: MatrixEvent, newState: PlaybackState): void { // Remember where the user got to in playback const wasLastPlaying = this.currentPlaybackId === mxEvent.getId(); - if (newState === PlaybackState.Stopped && this.clockStates.has(mxEvent.getId()) && !wasLastPlaying) { + if (newState === PlaybackState.Stopped && this.clockStates.has(mxEvent.getId()!) && !wasLastPlaying) { // noinspection JSIgnoredPromiseFromCall - playback.skipTo(this.clockStates.get(mxEvent.getId())!); + playback.skipTo(this.clockStates.get(mxEvent.getId()!)!); } else if (newState === PlaybackState.Stopped) { // Remove the now-useless clock for some space savings - this.clockStates.delete(mxEvent.getId()); + this.clockStates.delete(mxEvent.getId()!); if (wasLastPlaying) { this.recentFullPlays.add(this.currentPlaybackId); @@ -133,7 +133,7 @@ export class PlaybackQueue { // timeline is already most recent last, so we can iterate down that. const timeline = arrayFastClone(this.room.getLiveTimeline().getEvents()); let scanForVoiceMessage = false; - let nextEv: MatrixEvent; + let nextEv: MatrixEvent | undefined; for (const event of timeline) { if (event.getId() === mxEvent.getId()) { scanForVoiceMessage = true; @@ -149,8 +149,8 @@ export class PlaybackQueue { break; // Stop automatic playback: next useful event is not a voice message } - const havePlayback = this.playbacks.has(event.getId()); - const isRecentlyCompleted = this.recentFullPlays.has(event.getId()); + const havePlayback = this.playbacks.has(event.getId()!); + const isRecentlyCompleted = this.recentFullPlays.has(event.getId()!); if (havePlayback && !isRecentlyCompleted) { nextEv = event; break; @@ -164,7 +164,7 @@ export class PlaybackQueue { } else { this.playbackIdOrder = orderClone; - const instance = this.playbacks.get(nextEv.getId()); + const instance = this.playbacks.get(nextEv.getId()!); PlaybackManager.instance.pauseAllExcept(instance); // This should cause a Play event, which will re-populate our playback order @@ -196,7 +196,7 @@ export class PlaybackQueue { } } - this.currentPlaybackId = mxEvent.getId(); + this.currentPlaybackId = mxEvent.getId()!; if (order.length === 0 || order[order.length - 1] !== this.currentPlaybackId) { order.push(this.currentPlaybackId); } @@ -214,7 +214,7 @@ export class PlaybackQueue { if (playback.currentState === PlaybackState.Decoding) return; // ignore pre-ready values if (playback.currentState !== PlaybackState.Stopped) { - this.clockStates.set(mxEvent.getId(), clocks[0]); // [0] is the current seek position + this.clockStates.set(mxEvent.getId()!, clocks[0]); // [0] is the current seek position } } } diff --git a/src/audio/VoiceRecording.ts b/src/audio/VoiceRecording.ts index f8f9f01b66..f4d7905c33 100644 --- a/src/audio/VoiceRecording.ts +++ b/src/audio/VoiceRecording.ts @@ -77,7 +77,7 @@ export class VoiceRecording extends EventEmitter implements IDestroyable { private targetMaxLength: number | null = TARGET_MAX_LENGTH; public amplitudes: number[] = []; // at each second mark, generated private liveWaveform = new FixedRollingArray(RECORDING_PLAYBACK_SAMPLES, 0); - public onDataAvailable: (data: ArrayBuffer) => void; + public onDataAvailable?: (data: ArrayBuffer) => void; public get contentType(): string { return "audio/ogg"; @@ -181,7 +181,7 @@ export class VoiceRecording extends EventEmitter implements IDestroyable { }); // not using EventEmitter here because it leads to detached bufferes - this.recorder.ondataavailable = (data: ArrayBuffer) => this?.onDataAvailable(data); + this.recorder.ondataavailable = (data: ArrayBuffer) => this.onDataAvailable?.(data); } catch (e) { logger.error("Error starting recording: ", e); if (e instanceof DOMException) { diff --git a/src/autocomplete/AutocompleteProvider.tsx b/src/autocomplete/AutocompleteProvider.tsx index 32c2d80c6f..0b1fe2dd9e 100644 --- a/src/autocomplete/AutocompleteProvider.tsx +++ b/src/autocomplete/AutocompleteProvider.tsx @@ -70,7 +70,7 @@ export default abstract class AutocompleteProvider { * @param {boolean} force True if the user is forcing completion * @return {object} { command, range } where both objects fields are null if no match */ - public getCurrentCommand(query: string, selection: ISelectionRange, force = false): ICommand | null { + public getCurrentCommand(query: string, selection: ISelectionRange, force = false): Partial { let commandRegex = this.commandRegex; if (force && this.shouldForceComplete()) { @@ -78,7 +78,7 @@ export default abstract class AutocompleteProvider { } if (!commandRegex) { - return null; + return {}; } commandRegex.lastIndex = 0; diff --git a/src/autocomplete/CommandProvider.tsx b/src/autocomplete/CommandProvider.tsx index 113c928790..995760f4b3 100644 --- a/src/autocomplete/CommandProvider.tsx +++ b/src/autocomplete/CommandProvider.tsx @@ -95,7 +95,7 @@ export default class CommandProvider extends AutocompleteProvider { description={_t(result.description)} /> ), - range, + range: range!, }; }); } diff --git a/src/autocomplete/EmojiProvider.tsx b/src/autocomplete/EmojiProvider.tsx index 6b55dbf857..9c0acff4cd 100644 --- a/src/autocomplete/EmojiProvider.tsx +++ b/src/autocomplete/EmojiProvider.tsx @@ -94,7 +94,7 @@ export default class EmojiProvider extends AutocompleteProvider { shouldMatchWordsOnly: true, }); - this.recentlyUsed = Array.from(new Set(recent.get().map(getEmojiFromUnicode).filter(Boolean))); + this.recentlyUsed = Array.from(new Set(recent.get().map(getEmojiFromUnicode).filter(Boolean))) as IEmoji[]; } public async getCompletions( @@ -152,7 +152,7 @@ export default class EmojiProvider extends AutocompleteProvider { {c.emoji.unicode} ), - range, + range: range!, })); } return []; diff --git a/src/autocomplete/NotifProvider.tsx b/src/autocomplete/NotifProvider.tsx index 5efe0e86f6..d4a4793ab5 100644 --- a/src/autocomplete/NotifProvider.tsx +++ b/src/autocomplete/NotifProvider.tsx @@ -40,12 +40,13 @@ export default class NotifProvider extends AutocompleteProvider { ): Promise { const client = MatrixClientPeg.get(); - if (!this.room.currentState.mayTriggerNotifOfType("room", client.credentials.userId)) return []; + if (!this.room.currentState.mayTriggerNotifOfType("room", client.credentials.userId!)) return []; const { command, range } = this.getCurrentCommand(query, selection, force); if ( - command?.[0].length > 1 && - ["@room", "@channel", "@everyone", "@here"].some((c) => c.startsWith(command[0])) + command?.[0] && + command[0].length > 1 && + ["@room", "@channel", "@everyone", "@here"].some((c) => c.startsWith(command![0])) ) { return [ { @@ -58,7 +59,7 @@ export default class NotifProvider extends AutocompleteProvider { ), - range, + range: range!, }, ]; } diff --git a/src/autocomplete/QueryMatcher.ts b/src/autocomplete/QueryMatcher.ts index 1f7b5a5a7f..031f0b0122 100644 --- a/src/autocomplete/QueryMatcher.ts +++ b/src/autocomplete/QueryMatcher.ts @@ -88,7 +88,7 @@ export default class QueryMatcher { if (!this._items.has(key)) { this._items.set(key, []); } - this._items.get(key).push({ + this._items.get(key)!.push({ keyWeight: Number(index), object, }); @@ -104,7 +104,11 @@ export default class QueryMatcher { if (query.length === 0) { return []; } - const matches = []; + const matches: { + index: number; + object: T; + keyWeight: number; + }[] = []; // Iterate through the map & check each key. // ES6 Map iteration order is defined to be insertion order, so results // here will come out in the order they were put in. diff --git a/src/autocomplete/RoomProvider.tsx b/src/autocomplete/RoomProvider.tsx index 9cde501365..3b86f16f1c 100644 --- a/src/autocomplete/RoomProvider.tsx +++ b/src/autocomplete/RoomProvider.tsx @@ -39,12 +39,12 @@ function canonicalScore(displayedAlias: string, room: Room): number { function matcherObject( room: Room, - displayedAlias: string | null, + displayedAlias: string, matchName = "", ): { room: Room; matchName: string; - displayedAlias: string | null; + displayedAlias: string; } { return { room, @@ -81,7 +81,7 @@ export default class RoomProvider extends AutocompleteProvider { // the only reason we need to do this is because Fuse only matches on properties let matcherObjects = this.getRooms().reduce[]>((aliases, room) => { if (room.getCanonicalAlias()) { - aliases = aliases.concat(matcherObject(room, room.getCanonicalAlias(), room.name)); + aliases = aliases.concat(matcherObject(room, room.getCanonicalAlias()!, room.name)); } if (room.getAltAliases().length) { const altAliases = room.getAltAliases().map((alias) => matcherObject(room, alias)); @@ -122,7 +122,7 @@ export default class RoomProvider extends AutocompleteProvider { ), - range, + range: range!, }), ) .filter((completion) => !!completion.completion && completion.completion.length > 0); diff --git a/src/autocomplete/UserProvider.tsx b/src/autocomplete/UserProvider.tsx index 5e8d25f4c8..0ba5f656d8 100644 --- a/src/autocomplete/UserProvider.tsx +++ b/src/autocomplete/UserProvider.tsx @@ -44,7 +44,7 @@ const FORCED_USER_REGEX = /[^/,:; \t\n]\S*/g; export default class UserProvider extends AutocompleteProvider { public matcher: QueryMatcher; - public users: RoomMember[]; + public users: RoomMember[] | null; public room: Room; public constructor(room: Room, renderingType?: TimelineRenderingType) { @@ -54,7 +54,7 @@ export default class UserProvider extends AutocompleteProvider { renderingType, }); this.room = room; - this.matcher = new QueryMatcher([], { + this.matcher = new QueryMatcher([], { keys: ["name"], funcs: [(obj) => obj.userId.slice(1)], // index by user id minus the leading '@' shouldMatchWordsOnly: false, @@ -73,7 +73,7 @@ export default class UserProvider extends AutocompleteProvider { private onRoomTimeline = ( ev: MatrixEvent, - room: Room | null, + room: Room | undefined, toStartOfTimeline: boolean, removed: boolean, data: IRoomTimelineData, @@ -118,7 +118,7 @@ export default class UserProvider extends AutocompleteProvider { // Don't include the '@' in our search query - it's only used as a way to trigger completion const query = fullMatch.startsWith("@") ? fullMatch.substring(1) : fullMatch; return this.matcher.match(query, limit).map((user) => { - const description = UserIdentifierCustomisations.getDisplayUserIdentifier(user.userId, { + const description = UserIdentifierCustomisations.getDisplayUserIdentifier?.(user.userId, { roomId: this.room.roomId, withDisplayName: true, }); @@ -129,14 +129,14 @@ export default class UserProvider extends AutocompleteProvider { completion: user.rawDisplayName, completionId: user.userId, type: "user", - suffix: selection.beginning && range.start === 0 ? ": " : " ", + suffix: selection.beginning && range!.start === 0 ? ": " : " ", href: makeUserPermalink(user.userId), component: ( ), - range, + range: range!, }; }); } @@ -152,7 +152,7 @@ export default class UserProvider extends AutocompleteProvider { const lastSpoken: Record = {}; for (const event of events) { - lastSpoken[event.getSender()] = event.getTs(); + lastSpoken[event.getSender()!] = event.getTs(); } const currentUserId = MatrixClientPeg.get().credentials.userId; @@ -164,7 +164,7 @@ export default class UserProvider extends AutocompleteProvider { this.matcher.setObjects(this.users); } - public onUserSpoke(user: RoomMember): void { + public onUserSpoke(user: RoomMember | null): void { if (!this.users) return; if (!user) return; if (user.userId === MatrixClientPeg.get().credentials.userId) return; diff --git a/src/components/structures/AutoHideScrollbar.tsx b/src/components/structures/AutoHideScrollbar.tsx index 90fda3fe21..efbbbccb55 100644 --- a/src/components/structures/AutoHideScrollbar.tsx +++ b/src/components/structures/AutoHideScrollbar.tsx @@ -55,7 +55,7 @@ export default class AutoHideScrollbar ex } } - public render(): JSX.Element { + public render(): React.ReactNode { // eslint-disable-next-line @typescript-eslint/no-unused-vars const { element, className, onScroll, tabIndex, wrappedRef, children, ...otherProps } = this.props; diff --git a/src/components/structures/EmbeddedPage.tsx b/src/components/structures/EmbeddedPage.tsx index e3cacf0114..cbd7d885c7 100644 --- a/src/components/structures/EmbeddedPage.tsx +++ b/src/components/structures/EmbeddedPage.tsx @@ -118,7 +118,7 @@ export default class EmbeddedPage extends React.PureComponent { } }; - public render(): JSX.Element { + public render(): React.ReactNode { // HACK: Workaround for the context's MatrixClient not updating. const client = this.context || MatrixClientPeg.get(); const isGuest = client ? client.isGuest() : true; diff --git a/src/components/structures/FilePanel.tsx b/src/components/structures/FilePanel.tsx index 1f6c1d2583..1b53b7d293 100644 --- a/src/components/structures/FilePanel.tsx +++ b/src/components/structures/FilePanel.tsx @@ -223,7 +223,7 @@ class FilePanel extends React.Component { } } - public render(): JSX.Element { + public render(): React.ReactNode { if (MatrixClientPeg.get().isGuest()) { return ( diff --git a/src/components/structures/GenericErrorPage.tsx b/src/components/structures/GenericErrorPage.tsx index 4261d9b2f4..4f348daf01 100644 --- a/src/components/structures/GenericErrorPage.tsx +++ b/src/components/structures/GenericErrorPage.tsx @@ -22,7 +22,7 @@ interface IProps { } export default class GenericErrorPage extends React.PureComponent { - public render(): JSX.Element { + public render(): React.ReactNode { return (
diff --git a/src/components/structures/IndicatorScrollbar.tsx b/src/components/structures/IndicatorScrollbar.tsx index 1476198239..c7cde582d3 100644 --- a/src/components/structures/IndicatorScrollbar.tsx +++ b/src/components/structures/IndicatorScrollbar.tsx @@ -177,7 +177,7 @@ export default class IndicatorScrollbar e } }; - public render(): JSX.Element { + public render(): React.ReactNode { // eslint-disable-next-line @typescript-eslint/no-unused-vars const { children, trackHorizontalOverflow, verticalScrollsHorizontally, ...otherProps } = this.props; diff --git a/src/components/structures/InteractiveAuth.tsx b/src/components/structures/InteractiveAuth.tsx index f11b239052..fd83f0aea2 100644 --- a/src/components/structures/InteractiveAuth.tsx +++ b/src/components/structures/InteractiveAuth.tsx @@ -249,7 +249,7 @@ export default class InteractiveAuthComponent extends React.Component { this._roomView.current?.handleScrollKey(ev); }; - public render(): JSX.Element { + public render(): React.ReactNode { let pageElement; switch (this.props.page_type) { diff --git a/src/components/structures/MainSplit.tsx b/src/components/structures/MainSplit.tsx index 1254fbc6f3..e945496311 100644 --- a/src/components/structures/MainSplit.tsx +++ b/src/components/structures/MainSplit.tsx @@ -47,7 +47,7 @@ export default class MainSplit extends React.Component { }; private loadSidePanelSize(): { height: string | number; width: number } { - let rhsSize = parseInt(window.localStorage.getItem("mx_rhs_size"), 10); + let rhsSize = parseInt(window.localStorage.getItem("mx_rhs_size")!, 10); if (isNaN(rhsSize)) { rhsSize = 350; @@ -59,7 +59,7 @@ export default class MainSplit extends React.Component { }; } - public render(): JSX.Element { + public render(): React.ReactNode { const bodyView = React.Children.only(this.props.children); const panelView = this.props.panel; diff --git a/src/components/structures/MatrixChat.tsx b/src/components/structures/MatrixChat.tsx index 8bc29eb33a..66f681476b 100644 --- a/src/components/structures/MatrixChat.tsx +++ b/src/components/structures/MatrixChat.tsx @@ -2021,7 +2021,7 @@ export default class MatrixChat extends React.PureComponent { return fragmentAfterLogin; } - public render(): JSX.Element { + public render(): React.ReactNode { const fragmentAfterLogin = this.getFragmentAfterLogin(); let view = null; diff --git a/src/components/structures/MessagePanel.tsx b/src/components/structures/MessagePanel.tsx index c5dc249199..94265b11fa 100644 --- a/src/components/structures/MessagePanel.tsx +++ b/src/components/structures/MessagePanel.tsx @@ -982,7 +982,7 @@ export default class MessagePanel extends React.Component { } } - public render(): JSX.Element { + public render(): React.ReactNode { let topSpinner; let bottomSpinner; if (this.props.backPaginating) { diff --git a/src/components/structures/NonUrgentToastContainer.tsx b/src/components/structures/NonUrgentToastContainer.tsx index 508812ae16..f5f5b29d63 100644 --- a/src/components/structures/NonUrgentToastContainer.tsx +++ b/src/components/structures/NonUrgentToastContainer.tsx @@ -45,7 +45,7 @@ export default class NonUrgentToastContainer extends React.PureComponent { return (
diff --git a/src/components/structures/NotificationPanel.tsx b/src/components/structures/NotificationPanel.tsx index 7a72ea67f7..67e3523f38 100644 --- a/src/components/structures/NotificationPanel.tsx +++ b/src/components/structures/NotificationPanel.tsx @@ -55,7 +55,7 @@ export default class NotificationPanel extends React.PureComponent

{_t("You're all caught up")}

diff --git a/src/components/structures/PictureInPictureDragger.tsx b/src/components/structures/PictureInPictureDragger.tsx index 40c1caee6f..2456e63303 100644 --- a/src/components/structures/PictureInPictureDragger.tsx +++ b/src/components/structures/PictureInPictureDragger.tsx @@ -245,7 +245,7 @@ export default class PictureInPictureDragger extends React.Component { } }; - public render(): JSX.Element { + public render(): React.ReactNode { const style = { transform: `translateX(${this.translationX}px) translateY(${this.translationY}px)`, }; diff --git a/src/components/structures/PipContainer.tsx b/src/components/structures/PipContainer.tsx index 0697f4a6da..d2cde6a76e 100644 --- a/src/components/structures/PipContainer.tsx +++ b/src/components/structures/PipContainer.tsx @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import React, { MutableRefObject, useContext, useRef } from "react"; +import React, { MutableRefObject, ReactNode, useContext, useRef } from "react"; import { CallEvent, CallState, MatrixCall } from "matrix-js-sdk/src/webrtc/call"; import { logger } from "matrix-js-sdk/src/logger"; import { Optional } from "matrix-events-sdk"; @@ -288,7 +288,7 @@ class PipContainerInner extends React.Component { ); } - public render(): JSX.Element { + public render(): ReactNode { const pipMode = true; let pipContent: Array = []; diff --git a/src/components/structures/RightPanel.tsx b/src/components/structures/RightPanel.tsx index 60138dd442..4f27392e25 100644 --- a/src/components/structures/RightPanel.tsx +++ b/src/components/structures/RightPanel.tsx @@ -149,7 +149,7 @@ export default class RightPanel extends React.Component { this.setState({ searchQuery }); }; - public render(): JSX.Element { + public render(): React.ReactNode { let card =
; const roomId = this.props.room?.roomId; const phase = this.props.overwriteCard?.phase ?? this.state.phase; diff --git a/src/components/structures/RoomSearchView.tsx b/src/components/structures/RoomSearchView.tsx index 132e2a191b..93ed8e4c51 100644 --- a/src/components/structures/RoomSearchView.tsx +++ b/src/components/structures/RoomSearchView.tsx @@ -111,11 +111,11 @@ export const RoomSearchView = forwardRef( ); if (!bundledRelationship || event.getThread()) continue; const room = client.getRoom(event.getRoomId()); - const thread = room.findThreadForEvent(event); + const thread = room?.findThreadForEvent(event); if (thread) { event.setThread(thread); } else { - room.createThread(event.getId(), event, [], true); + room?.createThread(event.getId()!, event, [], true); } } } @@ -214,7 +214,7 @@ export const RoomSearchView = forwardRef( scrollPanel?.checkScroll(); }; - let lastRoomId: string; + let lastRoomId: string | undefined; let mergedTimeline: MatrixEvent[] = []; let ourEventsIndexes: number[] = []; diff --git a/src/components/structures/RoomStatusBar.tsx b/src/components/structures/RoomStatusBar.tsx index 3a4af77441..ff9d4472d4 100644 --- a/src/components/structures/RoomStatusBar.tsx +++ b/src/components/structures/RoomStatusBar.tsx @@ -213,7 +213,7 @@ export default class RoomStatusBar extends React.PureComponent { {}, { consentLink: (sub) => ( - + {sub} ), @@ -272,7 +272,7 @@ export default class RoomStatusBar extends React.PureComponent { ); } - public render(): JSX.Element { + public render(): React.ReactNode { if (this.shouldShowConnectionError()) { return (
diff --git a/src/components/structures/RoomView.tsx b/src/components/structures/RoomView.tsx index 6e2b72cf9f..d71ae223b1 100644 --- a/src/components/structures/RoomView.tsx +++ b/src/components/structures/RoomView.tsx @@ -1879,7 +1879,7 @@ export class RoomView extends React.Component { ); } - public render(): JSX.Element { + public render(): React.ReactNode { if (this.state.room instanceof LocalRoom) { if (this.state.room.state === LocalRoomState.CREATING) { return this.renderLocalRoomCreateLoader(); diff --git a/src/components/structures/SearchBox.tsx b/src/components/structures/SearchBox.tsx index a0777f2d52..16c2df3173 100644 --- a/src/components/structures/SearchBox.tsx +++ b/src/components/structures/SearchBox.tsx @@ -24,7 +24,7 @@ import { getKeyBindingsManager } from "../../KeyBindingsManager"; import { KeyBindingAction } from "../../accessibility/KeyboardShortcuts"; interface IProps extends HTMLProps { - onSearch?: (query: string) => void; + onSearch: (query: string) => void; onCleared?: (source?: string) => void; onKeyDown?: (ev: React.KeyboardEvent) => void; onFocus?: (ev: React.FocusEvent) => void; @@ -62,7 +62,7 @@ export default class SearchBox extends React.Component { private onSearch = throttle( (): void => { - this.props.onSearch(this.search.current.value); + this.props.onSearch(this.search.current?.value); }, 200, { trailing: true, leading: true }, @@ -101,7 +101,7 @@ export default class SearchBox extends React.Component { } } - public render(): JSX.Element { + public render(): React.ReactNode { /* eslint @typescript-eslint/no-unused-vars: ["error", { "ignoreRestSiblings": true }] */ const { onSearch, diff --git a/src/components/structures/SpaceRoomView.tsx b/src/components/structures/SpaceRoomView.tsx index 6d28106ddb..0abbf996cb 100644 --- a/src/components/structures/SpaceRoomView.tsx +++ b/src/components/structures/SpaceRoomView.tsx @@ -814,7 +814,7 @@ export default class SpaceRoomView extends React.PureComponent { } } - public render(): JSX.Element { + public render(): React.ReactNode { const rightPanel = this.state.showRightPanel && this.state.phase === Phase.Landing ? ( diff --git a/src/components/structures/ThreadView.tsx b/src/components/structures/ThreadView.tsx index ae93080937..8eaf3f2be9 100644 --- a/src/components/structures/ThreadView.tsx +++ b/src/components/structures/ThreadView.tsx @@ -343,7 +343,7 @@ export default class ThreadView extends React.Component { ); }; - public render(): JSX.Element { + public render(): React.ReactNode { const highlightedEventId = this.props.isInitialEventHighlighted ? this.props.initialEvent?.getId() : null; const threadRelation = this.threadRelation; diff --git a/src/components/structures/TimelinePanel.tsx b/src/components/structures/TimelinePanel.tsx index f49a3ea896..7e859e15cc 100644 --- a/src/components/structures/TimelinePanel.tsx +++ b/src/components/structures/TimelinePanel.tsx @@ -1886,7 +1886,7 @@ class TimelinePanel extends React.Component { this.callEventGroupers = buildLegacyCallEventGroupers(this.callEventGroupers, events); } - public render(): JSX.Element { + public render(): React.ReactNode { // just show a spinner while the timeline loads. // // put it in a div of the right class (mx_RoomView_messagePanel) so diff --git a/src/components/structures/ToastContainer.tsx b/src/components/structures/ToastContainer.tsx index 378c33b513..c95f5a1099 100644 --- a/src/components/structures/ToastContainer.tsx +++ b/src/components/structures/ToastContainer.tsx @@ -50,7 +50,7 @@ export default class ToastContainer extends React.Component<{}, IState> { }); }; - public render(): JSX.Element { + public render(): React.ReactNode { const totalCount = this.state.toasts.length; const isStacked = totalCount > 1; let toast; diff --git a/src/components/structures/UploadBar.tsx b/src/components/structures/UploadBar.tsx index c928c42ec4..c87ad4754f 100644 --- a/src/components/structures/UploadBar.tsx +++ b/src/components/structures/UploadBar.tsx @@ -103,7 +103,7 @@ export default class UploadBar extends React.PureComponent { ContentMessages.sharedInstance().cancelUpload(this.state.currentUpload!); }; - public render(): JSX.Element { + public render(): React.ReactNode { if (!this.state.currentFile) { return null; } diff --git a/src/components/structures/UserMenu.tsx b/src/components/structures/UserMenu.tsx index 302f01f311..aea40bbe57 100644 --- a/src/components/structures/UserMenu.tsx +++ b/src/components/structures/UserMenu.tsx @@ -429,7 +429,7 @@ export default class UserMenu extends React.Component { ); }; - public render(): JSX.Element { + public render(): React.ReactNode { const avatarSize = 32; // should match border-radius of the avatar const userId = MatrixClientPeg.get().getUserId(); diff --git a/src/components/structures/UserView.tsx b/src/components/structures/UserView.tsx index 226de3e233..a5cdb0b584 100644 --- a/src/components/structures/UserView.tsx +++ b/src/components/structures/UserView.tsx @@ -18,6 +18,7 @@ limitations under the License. import React from "react"; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { RoomMember } from "matrix-js-sdk/src/models/room-member"; +import { MatrixClient } from "matrix-js-sdk/src/matrix"; import { MatrixClientPeg } from "../../MatrixClientPeg"; import Modal from "../../Modal"; @@ -31,7 +32,7 @@ import { RightPanelPhases } from "../../stores/right-panel/RightPanelStorePhases import { UserOnboardingPage } from "../views/user-onboarding/UserOnboardingPage"; interface IProps { - userId?: string; + userId: string; resizeNotifier: ResizeNotifier; } @@ -66,7 +67,7 @@ export default class UserView extends React.Component { private async loadProfileInfo(): Promise { const cli = MatrixClientPeg.get(); this.setState({ loading: true }); - let profileInfo; + let profileInfo: Awaited>; try { profileInfo = await cli.getProfileInfo(this.props.userId); } catch (err) { @@ -83,7 +84,7 @@ export default class UserView extends React.Component { this.setState({ member, loading: false }); } - public render(): JSX.Element { + public render(): React.ReactNode { if (this.state.loading) { return ; } else if (this.state.member) { diff --git a/src/components/structures/ViewSource.tsx b/src/components/structures/ViewSource.tsx index 245c1587c5..faf445cef5 100644 --- a/src/components/structures/ViewSource.tsx +++ b/src/components/structures/ViewSource.tsx @@ -142,7 +142,7 @@ export default class ViewSource extends React.Component { return room.currentState.mayClientSendStateEvent(mxEvent.getType(), cli); } - public render(): JSX.Element { + public render(): React.ReactNode { const mxEvent = this.props.mxEvent.replacingEvent() || this.props.mxEvent; // show the replacing event, not the original, if it is an edit const isEditing = this.state.isEditing; diff --git a/src/components/structures/auth/CompleteSecurity.tsx b/src/components/structures/auth/CompleteSecurity.tsx index 7b898d694c..3171a0ec88 100644 --- a/src/components/structures/auth/CompleteSecurity.tsx +++ b/src/components/structures/auth/CompleteSecurity.tsx @@ -57,7 +57,7 @@ export default class CompleteSecurity extends React.Component { store.stop(); } - public render(): JSX.Element { + public render(): React.ReactNode { const { phase, lostKeys } = this.state; let icon; let title; diff --git a/src/components/structures/auth/E2eSetup.tsx b/src/components/structures/auth/E2eSetup.tsx index 6c112a99aa..80c18401dc 100644 --- a/src/components/structures/auth/E2eSetup.tsx +++ b/src/components/structures/auth/E2eSetup.tsx @@ -27,7 +27,7 @@ interface IProps { } export default class E2eSetup extends React.Component { - public render(): JSX.Element { + public render(): React.ReactNode { return ( diff --git a/src/components/structures/auth/ForgotPassword.tsx b/src/components/structures/auth/ForgotPassword.tsx index 94399bf88c..c3a6201252 100644 --- a/src/components/structures/auth/ForgotPassword.tsx +++ b/src/components/structures/auth/ForgotPassword.tsx @@ -487,7 +487,7 @@ export default class ForgotPassword extends React.Component { ); } - public render(): JSX.Element { + public render(): React.ReactNode { let resetPasswordJsx: JSX.Element; switch (this.state.phase) { diff --git a/src/components/structures/auth/Login.tsx b/src/components/structures/auth/Login.tsx index b0303245f9..8bd72ad43c 100644 --- a/src/components/structures/auth/Login.tsx +++ b/src/components/structures/auth/Login.tsx @@ -563,7 +563,7 @@ export default class LoginComponent extends React.PureComponent ); }; - public render(): JSX.Element { + public render(): React.ReactNode { const loader = this.isBusy() && !this.state.busyLoggingIn ? (
diff --git a/src/components/structures/auth/Registration.tsx b/src/components/structures/auth/Registration.tsx index 7cfebc6d0a..196b390417 100644 --- a/src/components/structures/auth/Registration.tsx +++ b/src/components/structures/auth/Registration.tsx @@ -573,7 +573,7 @@ export default class Registration extends React.Component { } } - public render(): JSX.Element { + public render(): React.ReactNode { let errorText; const err = this.state.errorText; if (err) { diff --git a/src/components/structures/auth/SetupEncryptionBody.tsx b/src/components/structures/auth/SetupEncryptionBody.tsx index 4eec31a226..c3270c52c2 100644 --- a/src/components/structures/auth/SetupEncryptionBody.tsx +++ b/src/components/structures/auth/SetupEncryptionBody.tsx @@ -141,7 +141,7 @@ export default class SetupEncryptionBody extends React.Component this.props.onFinished(); }; - public render(): JSX.Element { + public render(): React.ReactNode { const { phase, lostKeys } = this.state; if (this.state.verificationRequest) { diff --git a/src/components/structures/auth/SoftLogout.tsx b/src/components/structures/auth/SoftLogout.tsx index e3cb98bd86..46e8568697 100644 --- a/src/components/structures/auth/SoftLogout.tsx +++ b/src/components/structures/auth/SoftLogout.tsx @@ -326,7 +326,7 @@ export default class SoftLogout extends React.Component { ); } - public render(): JSX.Element { + public render(): React.ReactNode { return ( diff --git a/src/components/views/audio_messages/Clock.tsx b/src/components/views/audio_messages/Clock.tsx index 790de5bb89..ae0239cd42 100644 --- a/src/components/views/audio_messages/Clock.tsx +++ b/src/components/views/audio_messages/Clock.tsx @@ -43,7 +43,7 @@ export default class Clock extends React.Component { return currentFloor !== nextFloor; } - public render(): JSX.Element { + public render(): React.ReactNode { return ( {this.props.formatFn(this.props.seconds)} diff --git a/src/components/views/audio_messages/DurationClock.tsx b/src/components/views/audio_messages/DurationClock.tsx index 805c8f4f83..364fcb6c77 100644 --- a/src/components/views/audio_messages/DurationClock.tsx +++ b/src/components/views/audio_messages/DurationClock.tsx @@ -48,7 +48,7 @@ export default class DurationClock extends React.PureComponent { this.setState({ durationSeconds: time[1] }); }; - public render(): JSX.Element { + public render(): React.ReactNode { return ; } } diff --git a/src/components/views/audio_messages/LiveRecordingClock.tsx b/src/components/views/audio_messages/LiveRecordingClock.tsx index 50dd272a0d..0c8c6603d2 100644 --- a/src/components/views/audio_messages/LiveRecordingClock.tsx +++ b/src/components/views/audio_messages/LiveRecordingClock.tsx @@ -59,7 +59,7 @@ export default class LiveRecordingClock extends React.PureComponent; } } diff --git a/src/components/views/audio_messages/LiveRecordingWaveform.tsx b/src/components/views/audio_messages/LiveRecordingWaveform.tsx index 050a01a21e..47a4d5884f 100644 --- a/src/components/views/audio_messages/LiveRecordingWaveform.tsx +++ b/src/components/views/audio_messages/LiveRecordingWaveform.tsx @@ -63,7 +63,7 @@ export default class LiveRecordingWaveform extends React.PureComponent; } } diff --git a/src/components/views/audio_messages/PlaybackClock.tsx b/src/components/views/audio_messages/PlaybackClock.tsx index c5e569ce92..5dd7dc14cf 100644 --- a/src/components/views/audio_messages/PlaybackClock.tsx +++ b/src/components/views/audio_messages/PlaybackClock.tsx @@ -65,7 +65,7 @@ export default class PlaybackClock extends React.PureComponent { this.setState({ seconds: time[0], durationSeconds: time[1] }); }; - public render(): JSX.Element { + public render(): React.ReactNode { let seconds = this.state.seconds; if (this.state.playbackPhase === PlaybackState.Stopped) { if (Number.isFinite(this.props.defaultDisplaySeconds)) { diff --git a/src/components/views/audio_messages/PlaybackWaveform.tsx b/src/components/views/audio_messages/PlaybackWaveform.tsx index 32c34db6b2..19fd5de797 100644 --- a/src/components/views/audio_messages/PlaybackWaveform.tsx +++ b/src/components/views/audio_messages/PlaybackWaveform.tsx @@ -61,7 +61,7 @@ export default class PlaybackWaveform extends React.PureComponent; } } diff --git a/src/components/views/audio_messages/Waveform.tsx b/src/components/views/audio_messages/Waveform.tsx index 6c66eba234..ea3572022a 100644 --- a/src/components/views/audio_messages/Waveform.tsx +++ b/src/components/views/audio_messages/Waveform.tsx @@ -41,7 +41,7 @@ export default class Waveform extends React.PureComponent { progress: 1, }; - public render(): JSX.Element { + public render(): React.ReactNode { return (
{this.props.relHeights.map((h, i) => { diff --git a/src/components/views/auth/CaptchaForm.tsx b/src/components/views/auth/CaptchaForm.tsx index 6c16f972d6..9119743378 100644 --- a/src/components/views/auth/CaptchaForm.tsx +++ b/src/components/views/auth/CaptchaForm.tsx @@ -122,7 +122,7 @@ export default class CaptchaForm extends React.Component{this.state.errorText}
; diff --git a/src/components/views/auth/EmailField.tsx b/src/components/views/auth/EmailField.tsx index cb664d8352..2731503e38 100644 --- a/src/components/views/auth/EmailField.tsx +++ b/src/components/views/auth/EmailField.tsx @@ -74,7 +74,7 @@ class EmailField extends PureComponent { return result; }; - public render(): JSX.Element { + public render(): React.ReactNode { return ( ; } @@ -353,7 +353,7 @@ export class TermsAuthEntry extends React.Component; } @@ -442,7 +442,7 @@ export class EmailIdentityAuthEntry extends React.Component< this.props.onPhaseChange(DEFAULT_PHASE); } - public render(): JSX.Element { + public render(): React.ReactNode { let errorSection; // ignore the error when errcode is M_UNAUTHORIZED as we expect that error until the link is clicked. if (this.props.errorText && this.props.errorCode !== "M_UNAUTHORIZED") { @@ -650,7 +650,7 @@ export class MsisdnAuthEntry extends React.Component; } else { @@ -733,7 +733,7 @@ export class RegistrationTokenAuthEntry extends React.Component { } }; - public render(): JSX.Element { + public render(): React.ReactNode { let errorSection; if (this.props.errorText) { errorSection = ( diff --git a/src/components/views/auth/LoginWithQR.tsx b/src/components/views/auth/LoginWithQR.tsx index 4ca07323f7..80a57cab36 100644 --- a/src/components/views/auth/LoginWithQR.tsx +++ b/src/components/views/auth/LoginWithQR.tsx @@ -229,7 +229,7 @@ export default class LoginWithQR extends React.Component { } }; - public render(): JSX.Element { + public render(): React.ReactNode { return ( { ); }; - public render(): JSX.Element { + public render(): React.ReactNode { let title = ""; let titleIcon: JSX.Element | undefined; let main: JSX.Element | undefined; diff --git a/src/components/views/auth/PassphraseConfirmField.tsx b/src/components/views/auth/PassphraseConfirmField.tsx index 1d002310fa..a1fb67c528 100644 --- a/src/components/views/auth/PassphraseConfirmField.tsx +++ b/src/components/views/auth/PassphraseConfirmField.tsx @@ -65,7 +65,7 @@ class PassphraseConfirmField extends PureComponent { return result; }; - public render(): JSX.Element { + public render(): React.ReactNode { return ( { return result; }; - public render(): JSX.Element { + public render(): React.ReactNode { return ( { } } - public render(): JSX.Element { + public render(): React.ReactNode { let forgotPasswordJsx; if (this.props.onForgotPasswordClick) { diff --git a/src/components/views/auth/RegistrationForm.tsx b/src/components/views/auth/RegistrationForm.tsx index 4d2cd9214c..25a319e817 100644 --- a/src/components/views/auth/RegistrationForm.tsx +++ b/src/components/views/auth/RegistrationForm.tsx @@ -534,7 +534,7 @@ export default class RegistrationForm extends React.PureComponent ); diff --git a/src/components/views/avatars/MemberAvatar.tsx b/src/components/views/avatars/MemberAvatar.tsx index 4813871455..6760906450 100644 --- a/src/components/views/avatars/MemberAvatar.tsx +++ b/src/components/views/avatars/MemberAvatar.tsx @@ -109,7 +109,7 @@ export default function MemberAvatar({ } export class LegacyMemberAvatar extends React.Component { - public render(): JSX.Element { + public render(): React.ReactNode { return {this.props.children}; } } diff --git a/src/components/views/avatars/RoomAvatar.tsx b/src/components/views/avatars/RoomAvatar.tsx index 50389c7749..3a13dfdac4 100644 --- a/src/components/views/avatars/RoomAvatar.tsx +++ b/src/components/views/avatars/RoomAvatar.tsx @@ -135,7 +135,7 @@ export default class RoomAvatar extends React.Component { return this.props.room?.roomId || this.props.oobData?.roomId; } - public render(): JSX.Element { + public render(): React.ReactNode { const { room, oobData, viewAvatarOnClick, onClick, className, ...otherProps } = this.props; const roomName = room?.name ?? oobData.name; diff --git a/src/components/views/beta/BetaCard.tsx b/src/components/views/beta/BetaCard.tsx index c6b57f39c5..7fbf68b290 100644 --- a/src/components/views/beta/BetaCard.tsx +++ b/src/components/views/beta/BetaCard.tsx @@ -91,7 +91,7 @@ const BetaCard: React.FC = ({ title: titleOverride, featureId }) => { ); } - let refreshWarning: string; + let refreshWarning: string | undefined; if (requiresRefresh) { const brand = SdkConfig.get().brand; refreshWarning = value diff --git a/src/components/views/context_menus/DialpadContextMenu.tsx b/src/components/views/context_menus/DialpadContextMenu.tsx index 9d8c5c8e90..06cb566eb4 100644 --- a/src/components/views/context_menus/DialpadContextMenu.tsx +++ b/src/components/views/context_menus/DialpadContextMenu.tsx @@ -69,7 +69,7 @@ export default class DialpadContextMenu extends React.Component this.setState({ value: ev.target.value }); }; - public render(): JSX.Element { + public render(): React.ReactNode { return (
diff --git a/src/components/views/context_menus/GenericElementContextMenu.tsx b/src/components/views/context_menus/GenericElementContextMenu.tsx index e4b5203acc..5e3d55fbd5 100644 --- a/src/components/views/context_menus/GenericElementContextMenu.tsx +++ b/src/components/views/context_menus/GenericElementContextMenu.tsx @@ -47,7 +47,7 @@ export default class GenericElementContextMenu extends React.Component { } }; - public render(): JSX.Element { + public render(): React.ReactNode { return
{this.props.element}
; } } diff --git a/src/components/views/context_menus/GenericTextContextMenu.tsx b/src/components/views/context_menus/GenericTextContextMenu.tsx index 3e6b8a1114..c40b69216d 100644 --- a/src/components/views/context_menus/GenericTextContextMenu.tsx +++ b/src/components/views/context_menus/GenericTextContextMenu.tsx @@ -21,7 +21,7 @@ interface IProps { } export default class GenericTextContextMenu extends React.Component { - public render(): JSX.Element { + public render(): React.ReactNode { return (
{this.props.message} diff --git a/src/components/views/context_menus/LegacyCallContextMenu.tsx b/src/components/views/context_menus/LegacyCallContextMenu.tsx index 4de776ff06..e0b52a6de1 100644 --- a/src/components/views/context_menus/LegacyCallContextMenu.tsx +++ b/src/components/views/context_menus/LegacyCallContextMenu.tsx @@ -46,7 +46,7 @@ export default class LegacyCallContextMenu extends React.Component { this.props.onFinished(); }; - public render(): JSX.Element { + public render(): React.ReactNode { const holdUnholdCaption = this.props.call.isRemoteOnHold() ? _t("Resume") : _t("Hold"); const handler = this.props.call.isRemoteOnHold() ? this.onUnholdClick : this.onHoldClick; diff --git a/src/components/views/context_menus/MessageContextMenu.tsx b/src/components/views/context_menus/MessageContextMenu.tsx index 677565f7d8..b2b6c57b38 100644 --- a/src/components/views/context_menus/MessageContextMenu.tsx +++ b/src/components/views/context_menus/MessageContextMenu.tsx @@ -376,7 +376,7 @@ export default class MessageContextMenu extends React.Component this.closeMenu(); }; - public render(): JSX.Element { + public render(): React.ReactNode { const cli = MatrixClientPeg.get(); const me = cli.getUserId(); const { mxEvent, rightClick, link, eventTileOps, reactions, collapseReplyChain, ...other } = this.props; diff --git a/src/components/views/dialogs/AskInviteAnywayDialog.tsx b/src/components/views/dialogs/AskInviteAnywayDialog.tsx index a5638b475d..9b9982618a 100644 --- a/src/components/views/dialogs/AskInviteAnywayDialog.tsx +++ b/src/components/views/dialogs/AskInviteAnywayDialog.tsx @@ -48,7 +48,7 @@ export default class AskInviteAnywayDialog extends React.Component { this.props.onFinished(false); }; - public render(): JSX.Element { + public render(): React.ReactNode { const errorList = this.props.unknownProfileUsers.map((address) => (
  • {address.userId}: {address.errorText} diff --git a/src/components/views/dialogs/BaseDialog.tsx b/src/components/views/dialogs/BaseDialog.tsx index 1f16821ee5..484356ff2b 100644 --- a/src/components/views/dialogs/BaseDialog.tsx +++ b/src/components/views/dialogs/BaseDialog.tsx @@ -115,7 +115,7 @@ export default class BaseDialog extends React.Component { this.props.onFinished(false); }; - public render(): JSX.Element { + public render(): React.ReactNode { let cancelButton; if (this.props.hasCancel) { cancelButton = ( diff --git a/src/components/views/dialogs/BugReportDialog.tsx b/src/components/views/dialogs/BugReportDialog.tsx index e3ae127024..4074db6d3e 100644 --- a/src/components/views/dialogs/BugReportDialog.tsx +++ b/src/components/views/dialogs/BugReportDialog.tsx @@ -180,7 +180,7 @@ export default class BugReportDialog extends React.Component { this.setState({ downloadProgress }); }; - public render(): JSX.Element { + public render(): React.ReactNode { let error = null; if (this.state.err) { error =
    {this.state.err}
    ; diff --git a/src/components/views/dialogs/ChangelogDialog.tsx b/src/components/views/dialogs/ChangelogDialog.tsx index 1d7c3e196a..85af8203b7 100644 --- a/src/components/views/dialogs/ChangelogDialog.tsx +++ b/src/components/views/dialogs/ChangelogDialog.tsx @@ -86,7 +86,7 @@ export default class ChangelogDialog extends React.Component { ); } - public render(): JSX.Element { + public render(): React.ReactNode { const logs = REPOS.map((repo) => { let content; if (this.state[repo] == null) { diff --git a/src/components/views/dialogs/ConfirmAndWaitRedactDialog.tsx b/src/components/views/dialogs/ConfirmAndWaitRedactDialog.tsx index 1d8e488073..60e18eb263 100644 --- a/src/components/views/dialogs/ConfirmAndWaitRedactDialog.tsx +++ b/src/components/views/dialogs/ConfirmAndWaitRedactDialog.tsx @@ -72,7 +72,7 @@ export default class ConfirmAndWaitRedactDialog extends React.PureComponent { - public render(): JSX.Element { + public render(): React.ReactNode { return ( { this.props.onFinished(false); }; - public render(): JSX.Element { + public render(): React.ReactNode { return ( { ], }); - public render(): JSX.Element { + public render(): React.ReactNode { const isVideoRoom = this.props.type === RoomType.ElementVideo; let aliasField: JSX.Element; diff --git a/src/components/views/dialogs/DeactivateAccountDialog.tsx b/src/components/views/dialogs/DeactivateAccountDialog.tsx index 8876038ec4..403af3c0d3 100644 --- a/src/components/views/dialogs/DeactivateAccountDialog.tsx +++ b/src/components/views/dialogs/DeactivateAccountDialog.tsx @@ -182,7 +182,7 @@ export default class DeactivateAccountDialog extends React.Component{this.state.errStr}
  • ; diff --git a/src/components/views/dialogs/EndPollDialog.tsx b/src/components/views/dialogs/EndPollDialog.tsx index 463605553e..1951f881bb 100644 --- a/src/components/views/dialogs/EndPollDialog.tsx +++ b/src/components/views/dialogs/EndPollDialog.tsx @@ -67,7 +67,7 @@ export default class EndPollDialog extends React.Component { this.props.onFinished(endPoll); }; - public render(): JSX.Element { + public render(): React.ReactNode { return ( { this.props.onFinished(true); }; - public render(): JSX.Element { + public render(): React.ReactNode { return ( = (props: IProps) => { ); } - let bugReports = null; + let bugReports: JSX.Element | null = null; if (rageshakeUrl) { bugReports = (

    diff --git a/src/components/views/dialogs/IncomingSasDialog.tsx b/src/components/views/dialogs/IncomingSasDialog.tsx index 097fbd39a8..143b37ba51 100644 --- a/src/components/views/dialogs/IncomingSasDialog.tsx +++ b/src/components/views/dialogs/IncomingSasDialog.tsx @@ -256,7 +256,7 @@ export default class IncomingSasDialog extends React.Component { return ; } - public render(): JSX.Element { + public render(): React.ReactNode { let body; switch (this.state.phase) { case PHASE_START: diff --git a/src/components/views/dialogs/InfoDialog.tsx b/src/components/views/dialogs/InfoDialog.tsx index 1a64485c61..d4676ac496 100644 --- a/src/components/views/dialogs/InfoDialog.tsx +++ b/src/components/views/dialogs/InfoDialog.tsx @@ -44,7 +44,7 @@ export default class InfoDialog extends React.Component { this.props.onFinished(); }; - public render(): JSX.Element { + public render(): React.ReactNode { return ( dis.fire(Action.ViewUserSettings); }; - public render(): JSX.Element { + public render(): React.ReactNode { return ( our props > defaults. diff --git a/src/components/views/dialogs/InviteDialog.tsx b/src/components/views/dialogs/InviteDialog.tsx index 4cb29c61d7..fc20150a63 100644 --- a/src/components/views/dialogs/InviteDialog.tsx +++ b/src/components/views/dialogs/InviteDialog.tsx @@ -100,7 +100,7 @@ class DMUserTile extends React.PureComponent { this.props.onRemove(this.props.member); }; - public render(): JSX.Element { + public render(): React.ReactNode { const avatarSize = 20; const avatar = ; @@ -187,7 +187,7 @@ class DMRoomTile extends React.PureComponent { return result; } - public render(): JSX.Element { + public render(): React.ReactNode { let timestamp = null; if (this.props.lastActiveTs) { const humanTs = humanizeTime(this.props.lastActiveTs); @@ -1082,7 +1082,7 @@ export default class InviteDialog extends React.PureComponent; diff --git a/src/components/views/dialogs/LogoutDialog.tsx b/src/components/views/dialogs/LogoutDialog.tsx index dfb4a5fb37..af3fb65f6f 100644 --- a/src/components/views/dialogs/LogoutDialog.tsx +++ b/src/components/views/dialogs/LogoutDialog.tsx @@ -127,7 +127,7 @@ export default class LogoutDialog extends React.Component { this.props.onFinished(true); }; - public render(): JSX.Element { + public render(): React.ReactNode { if (this.state.shouldLoadBackupStatus) { const description = (

    diff --git a/src/components/views/dialogs/ManualDeviceKeyVerificationDialog.tsx b/src/components/views/dialogs/ManualDeviceKeyVerificationDialog.tsx index 742919c9ba..0819d72d7e 100644 --- a/src/components/views/dialogs/ManualDeviceKeyVerificationDialog.tsx +++ b/src/components/views/dialogs/ManualDeviceKeyVerificationDialog.tsx @@ -40,7 +40,7 @@ export default class ManualDeviceKeyVerificationDialog extends React.Component { } }; - public render(): JSX.Element { + public render(): React.ReactNode { let error = null; if (this.state.err) { error =
    {this.state.err}
    ; diff --git a/src/components/views/dialogs/RoomSettingsDialog.tsx b/src/components/views/dialogs/RoomSettingsDialog.tsx index 67b46b371e..d451d4a658 100644 --- a/src/components/views/dialogs/RoomSettingsDialog.tsx +++ b/src/components/views/dialogs/RoomSettingsDialog.tsx @@ -181,7 +181,7 @@ export default class RoomSettingsDialog extends React.Component return tabs; } - public render(): JSX.Element { + public render(): React.ReactNode { const roomName = this.state.roomName; return ( { }); }; - public render(): JSX.Element { + public render(): React.ReactNode { let buttons; if (this.state.busy) { buttons = ; diff --git a/src/components/views/dialogs/RoomUpgradeWarningDialog.tsx b/src/components/views/dialogs/RoomUpgradeWarningDialog.tsx index c3b2cd19bf..65652cec43 100644 --- a/src/components/views/dialogs/RoomUpgradeWarningDialog.tsx +++ b/src/components/views/dialogs/RoomUpgradeWarningDialog.tsx @@ -100,7 +100,7 @@ export default class RoomUpgradeWarningDialog extends React.Component { }); } - public render(): JSX.Element { + public render(): React.ReactNode { let timeline = this.renderTimeline().filter((c) => !!c); // remove nulls for next check if (timeline.length === 0) { timeline = [
    {_t("You're all caught up.")}
    ]; diff --git a/src/components/views/dialogs/ServerPickerDialog.tsx b/src/components/views/dialogs/ServerPickerDialog.tsx index 7c567dadf6..75436e03a8 100644 --- a/src/components/views/dialogs/ServerPickerDialog.tsx +++ b/src/components/views/dialogs/ServerPickerDialog.tsx @@ -163,7 +163,7 @@ export default class ServerPickerDialog extends React.PureComponent { - public render(): JSX.Element { + public render(): React.ReactNode { return ( { window.location.reload(); }; - public render(): JSX.Element { + public render(): React.ReactNode { const brand = SdkConfig.get().brand; const clearStorageButton = ( diff --git a/src/components/views/dialogs/SetEmailDialog.tsx b/src/components/views/dialogs/SetEmailDialog.tsx index 400b863428..6455517961 100644 --- a/src/components/views/dialogs/SetEmailDialog.tsx +++ b/src/components/views/dialogs/SetEmailDialog.tsx @@ -138,7 +138,7 @@ export default class SetEmailDialog extends React.Component { ); } - public render(): JSX.Element { + public render(): React.ReactNode { const emailInput = this.state.emailBusy ? ( ) : ( diff --git a/src/components/views/dialogs/ShareDialog.tsx b/src/components/views/dialogs/ShareDialog.tsx index 9a78b35b2f..353ad347e0 100644 --- a/src/components/views/dialogs/ShareDialog.tsx +++ b/src/components/views/dialogs/ShareDialog.tsx @@ -71,14 +71,14 @@ interface IProps extends IDialogProps { interface IState { linkSpecificEvent: boolean; - permalinkCreator: RoomPermalinkCreator; + permalinkCreator: RoomPermalinkCreator | null; } export default class ShareDialog extends React.PureComponent { public constructor(props: IProps) { super(props); - let permalinkCreator: RoomPermalinkCreator = null; + let permalinkCreator: RoomPermalinkCreator | null = null; if (props.target instanceof Room) { permalinkCreator = new RoomPermalinkCreator(props.target); permalinkCreator.load(); @@ -108,15 +108,15 @@ export default class ShareDialog extends React.PureComponent { if (this.props.target instanceof Room) { if (this.state.linkSpecificEvent) { const events = this.props.target.getLiveTimeline().getEvents(); - matrixToUrl = this.state.permalinkCreator.forEvent(events[events.length - 1].getId()); + matrixToUrl = this.state.permalinkCreator!.forEvent(events[events.length - 1].getId()!); } else { - matrixToUrl = this.state.permalinkCreator.forShareableRoom(); + matrixToUrl = this.state.permalinkCreator!.forShareableRoom(); } } else if (this.props.target instanceof User || this.props.target instanceof RoomMember) { matrixToUrl = makeUserPermalink(this.props.target.userId); } else if (this.props.target instanceof MatrixEvent) { if (this.state.linkSpecificEvent) { - matrixToUrl = this.props.permalinkCreator.forEvent(this.props.target.getId()); + matrixToUrl = this.props.permalinkCreator.forEvent(this.props.target.getId()!); } else { matrixToUrl = this.props.permalinkCreator.forShareableRoom(); } @@ -124,7 +124,7 @@ export default class ShareDialog extends React.PureComponent { return matrixToUrl; } - public render(): JSX.Element { + public render(): React.ReactNode { let title; let checkbox; diff --git a/src/components/views/dialogs/StorageEvictedDialog.tsx b/src/components/views/dialogs/StorageEvictedDialog.tsx index 18a70e032a..74af879731 100644 --- a/src/components/views/dialogs/StorageEvictedDialog.tsx +++ b/src/components/views/dialogs/StorageEvictedDialog.tsx @@ -37,7 +37,7 @@ export default class StorageEvictedDialog extends React.Component { this.props.onFinished(true); }; - public render(): JSX.Element { + public render(): React.ReactNode { let logRequest; if (SdkConfig.get().bug_report_endpoint_url) { logRequest = _t( diff --git a/src/components/views/dialogs/TermsDialog.tsx b/src/components/views/dialogs/TermsDialog.tsx index fd420d436c..57efd54b99 100644 --- a/src/components/views/dialogs/TermsDialog.tsx +++ b/src/components/views/dialogs/TermsDialog.tsx @@ -34,7 +34,7 @@ class TermsCheckbox extends React.PureComponent { this.props.onChange(this.props.url, ev.currentTarget.checked); }; - public render(): JSX.Element { + public render(): React.ReactNode { return ; } } @@ -126,7 +126,7 @@ export default class TermsDialog extends React.PureComponent { return result; }; - public render(): JSX.Element { + public render(): React.ReactNode { return ( { this.props.onFinished(true, true); }; - public render(): JSX.Element { + public render(): React.ReactNode { let title: string; if (this.props.totalFiles > 1 && this.props.currentIndex !== undefined) { title = _t("Upload files (%(current)s of %(total)s)", { diff --git a/src/components/views/dialogs/UploadFailureDialog.tsx b/src/components/views/dialogs/UploadFailureDialog.tsx index 03e142da05..2dd99e88a5 100644 --- a/src/components/views/dialogs/UploadFailureDialog.tsx +++ b/src/components/views/dialogs/UploadFailureDialog.tsx @@ -43,7 +43,7 @@ export default class UploadFailureDialog extends React.Component { this.props.onFinished(true); }; - public render(): JSX.Element { + public render(): React.ReactNode { let message; let preview; let buttons; diff --git a/src/components/views/dialogs/UserSettingsDialog.tsx b/src/components/views/dialogs/UserSettingsDialog.tsx index aca4a1b37b..5beae8ccaa 100644 --- a/src/components/views/dialogs/UserSettingsDialog.tsx +++ b/src/components/views/dialogs/UserSettingsDialog.tsx @@ -210,7 +210,7 @@ export default class UserSettingsDialog extends React.Component return tabs; } - public render(): JSX.Element { + public render(): React.ReactNode { return ( { diff --git a/src/components/views/dialogs/WidgetOpenIDPermissionsDialog.tsx b/src/components/views/dialogs/WidgetOpenIDPermissionsDialog.tsx index f33e392443..f185c5b7e6 100644 --- a/src/components/views/dialogs/WidgetOpenIDPermissionsDialog.tsx +++ b/src/components/views/dialogs/WidgetOpenIDPermissionsDialog.tsx @@ -73,7 +73,7 @@ export default class WidgetOpenIDPermissionsDialog extends React.PureComponent { } } - public render(): JSX.Element { + public render(): React.ReactNode { const brand = SdkConfig.get().brand; const displayName = this.state.roomMember ? this.state.roomMember.name : this.props.creatorUserId; diff --git a/src/components/views/elements/AppTile.tsx b/src/components/views/elements/AppTile.tsx index de0b1a17e1..b34415f93e 100644 --- a/src/components/views/elements/AppTile.tsx +++ b/src/components/views/elements/AppTile.tsx @@ -544,7 +544,7 @@ export default class AppTile extends React.Component { this.setState({ menuDisplayed: false }); }; - public render(): JSX.Element { + public render(): React.ReactNode { let appTileBody; // Note that there is advice saying allow-scripts shouldn't be used with allow-same-origin diff --git a/src/components/views/elements/DesktopCapturerSourcePicker.tsx b/src/components/views/elements/DesktopCapturerSourcePicker.tsx index 9d18fa89a4..ccb64ead30 100644 --- a/src/components/views/elements/DesktopCapturerSourcePicker.tsx +++ b/src/components/views/elements/DesktopCapturerSourcePicker.tsx @@ -55,7 +55,7 @@ export class ExistingSource extends React.Component { this.props.onSelect(this.props.source); }; - public render(): JSX.Element { + public render(): React.ReactNode { const thumbnailClasses = classNames({ mx_desktopCapturerSourcePicker_source_thumbnail: true, mx_desktopCapturerSourcePicker_source_thumbnail_selected: this.props.selected, @@ -149,7 +149,7 @@ export default class DesktopCapturerSourcePicker extends React.Component{sources}
    ); } - public render(): JSX.Element { + public render(): React.ReactNode { const tabs = [ this.getTab("screen", _t("Share entire screen")), this.getTab("window", _t("Application window")), diff --git a/src/components/views/elements/DialPadBackspaceButton.tsx b/src/components/views/elements/DialPadBackspaceButton.tsx index c6f3179b10..a7a80df882 100644 --- a/src/components/views/elements/DialPadBackspaceButton.tsx +++ b/src/components/views/elements/DialPadBackspaceButton.tsx @@ -25,7 +25,7 @@ interface IProps { } export default class DialPadBackspaceButton extends React.PureComponent { - public render(): JSX.Element { + public render(): React.ReactNode { return (
    { this.props.onCancel(event); }; - public render(): JSX.Element { + public render(): React.ReactNode { let primaryButtonClassName = "mx_Dialog_primary"; if (this.props.primaryButtonClass) { primaryButtonClassName += " " + this.props.primaryButtonClass; diff --git a/src/components/views/elements/Draggable.tsx b/src/components/views/elements/Draggable.tsx index 5ff299ef55..769980b59a 100644 --- a/src/components/views/elements/Draggable.tsx +++ b/src/components/views/elements/Draggable.tsx @@ -73,7 +73,7 @@ export default class Draggable extends React.Component { }); } - public render(): JSX.Element { + public render(): React.ReactNode { return
    ; } } diff --git a/src/components/views/elements/Dropdown.tsx b/src/components/views/elements/Dropdown.tsx index a41aa5321d..aecc8e8141 100644 --- a/src/components/views/elements/Dropdown.tsx +++ b/src/components/views/elements/Dropdown.tsx @@ -49,7 +49,7 @@ class MenuOption extends React.Component { this.props.onClick(this.props.dropdownKey); }; - public render(): JSX.Element { + public render(): React.ReactNode { const optClasses = classnames({ mx_Dropdown_option: true, mx_Dropdown_option_highlight: this.props.highlighted, @@ -327,7 +327,7 @@ export default class Dropdown extends React.Component { return options; } - public render(): JSX.Element { + public render(): React.ReactNode { let currentValue; const menuStyle: CSSProperties = {}; diff --git a/src/components/views/elements/EditableItemList.tsx b/src/components/views/elements/EditableItemList.tsx index 2d29976604..15bda060ed 100644 --- a/src/components/views/elements/EditableItemList.tsx +++ b/src/components/views/elements/EditableItemList.tsx @@ -57,7 +57,7 @@ export class EditableItem extends React.Component { this.setState({ verifyRemove: false }); }; - public render(): JSX.Element { + public render(): React.ReactNode { if (this.state.verifyRemove) { return (
    @@ -148,7 +148,7 @@ export default class EditableItemList

    extends React.PureComponent { if (!this.props.canRemove) { return

  • {item}
  • ; diff --git a/src/components/views/elements/EditableText.tsx b/src/components/views/elements/EditableText.tsx index 89d4220bca..b4695d552b 100644 --- a/src/components/views/elements/EditableText.tsx +++ b/src/components/views/elements/EditableText.tsx @@ -202,7 +202,7 @@ export default class EditableText extends React.Component { this.showPlaceholder(!this.value); }; - public render(): JSX.Element { + public render(): React.ReactNode { const { className, editable, initialValue, label, labelClassName } = this.props; let editableEl; diff --git a/src/components/views/elements/EditableTextContainer.tsx b/src/components/views/elements/EditableTextContainer.tsx index 1468b24e54..6e3132e226 100644 --- a/src/components/views/elements/EditableTextContainer.tsx +++ b/src/components/views/elements/EditableTextContainer.tsx @@ -133,7 +133,7 @@ export default class EditableTextContainer extends React.Component; } else if (this.state.errorString) { diff --git a/src/components/views/elements/EventListSummary.tsx b/src/components/views/elements/EventListSummary.tsx index 2a55eec8e1..1ba14bb051 100644 --- a/src/components/views/elements/EventListSummary.tsx +++ b/src/components/views/elements/EventListSummary.tsx @@ -495,7 +495,7 @@ export default class EventListSummary extends React.Component { }; } - public render(): JSX.Element { + public render(): React.ReactNode { const eventsToRender = this.props.events; // Map user IDs to latest Avatar Member. ES6 Maps are ordered by when the key was created, diff --git a/src/components/views/elements/EventTilePreview.tsx b/src/components/views/elements/EventTilePreview.tsx index 2f11351a4b..10d7b458cc 100644 --- a/src/components/views/elements/EventTilePreview.tsx +++ b/src/components/views/elements/EventTilePreview.tsx @@ -111,7 +111,7 @@ export default class EventTilePreview extends React.Component { return event; } - public render(): JSX.Element { + public render(): React.ReactNode { const className = classnames(this.props.className, { mx_IRCLayout: this.props.layout == Layout.IRC, mx_EventTilePreview_loader: !this.props.userId, diff --git a/src/components/views/elements/Field.tsx b/src/components/views/elements/Field.tsx index bdb5425195..1afe52810b 100644 --- a/src/components/views/elements/Field.tsx +++ b/src/components/views/elements/Field.tsx @@ -232,7 +232,7 @@ export default class Field extends React.PureComponent { return valid; } - public render(): JSX.Element { + public render(): React.ReactNode { /* eslint @typescript-eslint/no-unused-vars: ["error", { "ignoreRestSiblings": true }] */ const { element, diff --git a/src/components/views/elements/IRCTimelineProfileResizer.tsx b/src/components/views/elements/IRCTimelineProfileResizer.tsx index 5d6c244abf..af1585e997 100644 --- a/src/components/views/elements/IRCTimelineProfileResizer.tsx +++ b/src/components/views/elements/IRCTimelineProfileResizer.tsx @@ -91,7 +91,7 @@ export default class IRCTimelineProfileResizer extends React.Component; } } diff --git a/src/components/views/elements/ImageView.tsx b/src/components/views/elements/ImageView.tsx index ac5a78566e..5bc1f0562b 100644 --- a/src/components/views/elements/ImageView.tsx +++ b/src/components/views/elements/ImageView.tsx @@ -411,7 +411,7 @@ export default class ImageView extends React.Component { return {contextMenu}; } - public render(): JSX.Element { + public render(): React.ReactNode { const showEventMeta = !!this.props.mxEvent; let transitionClassName; diff --git a/src/components/views/elements/InfoTooltip.tsx b/src/components/views/elements/InfoTooltip.tsx index 7475b0f34f..ed68621f7c 100644 --- a/src/components/views/elements/InfoTooltip.tsx +++ b/src/components/views/elements/InfoTooltip.tsx @@ -39,7 +39,7 @@ export default class InfoTooltip extends React.PureComponent { super(props); } - public render(): JSX.Element { + public render(): React.ReactNode { const { tooltip, children, tooltipClassName, className, kind } = this.props; const title = _t("Information"); const iconClassName = diff --git a/src/components/views/elements/InlineSpinner.tsx b/src/components/views/elements/InlineSpinner.tsx index 4d06eda3d5..504231820e 100644 --- a/src/components/views/elements/InlineSpinner.tsx +++ b/src/components/views/elements/InlineSpinner.tsx @@ -30,7 +30,7 @@ export default class InlineSpinner extends React.PureComponent { h: 16, }; - public render(): JSX.Element { + public render(): React.ReactNode { return (
    { }); }; - public render(): JSX.Element { + public render(): React.ReactNode { const classes = classNames({ mx_InviteReason: true, mx_InviteReason_hidden: this.state.hidden, diff --git a/src/components/views/elements/LabelledToggleSwitch.tsx b/src/components/views/elements/LabelledToggleSwitch.tsx index 83a1e66f8a..4455b16a9f 100644 --- a/src/components/views/elements/LabelledToggleSwitch.tsx +++ b/src/components/views/elements/LabelledToggleSwitch.tsx @@ -43,7 +43,7 @@ interface IProps { } export default class LabelledToggleSwitch extends React.PureComponent { - public render(): JSX.Element { + public render(): React.ReactNode { // This is a minimal version of a SettingsFlag const { label, caption } = this.props; let firstPart = ( diff --git a/src/components/views/elements/LanguageDropdown.tsx b/src/components/views/elements/LanguageDropdown.tsx index 758e1a5e5b..ee03774cbc 100644 --- a/src/components/views/elements/LanguageDropdown.tsx +++ b/src/components/views/elements/LanguageDropdown.tsx @@ -83,7 +83,7 @@ export default class LanguageDropdown extends React.Component { }); }; - public render(): JSX.Element { + public render(): React.ReactNode { if (this.state.langs === null) { return ; } diff --git a/src/components/views/elements/LazyRenderList.tsx b/src/components/views/elements/LazyRenderList.tsx index 492cff95c9..e14941bd73 100644 --- a/src/components/views/elements/LazyRenderList.tsx +++ b/src/components/views/elements/LazyRenderList.tsx @@ -117,7 +117,7 @@ export default class LazyRenderList extends React.Component, return new ItemRange(topCount, renderCount, bottomCount); } - public render(): JSX.Element { + public render(): React.ReactNode { const { itemHeight, items, renderItem } = this.props; const { renderRange } = this.state; const { topCount, renderCount, bottomCount } = renderRange; diff --git a/src/components/views/elements/LinkWithTooltip.tsx b/src/components/views/elements/LinkWithTooltip.tsx index d682f34e46..88d29e4a86 100644 --- a/src/components/views/elements/LinkWithTooltip.tsx +++ b/src/components/views/elements/LinkWithTooltip.tsx @@ -25,7 +25,7 @@ export default class LinkWithTooltip extends React.Component { super(props); } - public render(): JSX.Element { + public render(): React.ReactNode { const { children, tooltip, ...props } = this.props; return ( diff --git a/src/components/views/elements/Measured.tsx b/src/components/views/elements/Measured.tsx index 2f7862c922..355429c454 100644 --- a/src/components/views/elements/Measured.tsx +++ b/src/components/views/elements/Measured.tsx @@ -64,7 +64,7 @@ export default class Measured extends React.PureComponent { this.props.onMeasurement(entry.contentRect.width <= this.props.breakpoint); }; - public render(): JSX.Element { + public render(): React.ReactNode { return null; } } diff --git a/src/components/views/elements/PersistedElement.tsx b/src/components/views/elements/PersistedElement.tsx index 1bcee67cfd..32d99c857d 100644 --- a/src/components/views/elements/PersistedElement.tsx +++ b/src/components/views/elements/PersistedElement.tsx @@ -191,7 +191,7 @@ export default class PersistedElement extends React.Component { }); } - public render(): JSX.Element { + public render(): React.ReactNode { return
    ; } } diff --git a/src/components/views/elements/Pill.tsx b/src/components/views/elements/Pill.tsx index e5df681cc7..5a8de9777d 100644 --- a/src/components/views/elements/Pill.tsx +++ b/src/components/views/elements/Pill.tsx @@ -214,7 +214,7 @@ export default class Pill extends React.Component { }); }; - public render(): JSX.Element { + public render(): React.ReactNode { const resource = this.state.resourceId; let avatar = null; diff --git a/src/components/views/elements/PowerSelector.tsx b/src/components/views/elements/PowerSelector.tsx index d2c0e7584e..f7a4ab4b81 100644 --- a/src/components/views/elements/PowerSelector.tsx +++ b/src/components/views/elements/PowerSelector.tsx @@ -148,7 +148,7 @@ export default class PowerSelector extends React.Component { } }; - public render(): JSX.Element { + public render(): React.ReactNode { let picker; const label = typeof this.props.label === "undefined" ? _t("Power level") : this.props.label; if (this.state.custom) { diff --git a/src/components/views/elements/ReplyChain.tsx b/src/components/views/elements/ReplyChain.tsx index 3c8bb2c1cf..3ca9c7dee7 100644 --- a/src/components/views/elements/ReplyChain.tsx +++ b/src/components/views/elements/ReplyChain.tsx @@ -199,7 +199,7 @@ export default class ReplyChain extends React.Component { return getUserNameColorClass(ev.getSender()).replace("Username", "ReplyChain"); } - public render(): JSX.Element { + public render(): React.ReactNode { let header = null; if (this.state.err) { header = ( diff --git a/src/components/views/elements/RoomAliasField.tsx b/src/components/views/elements/RoomAliasField.tsx index f03b40173a..b2e6965c63 100644 --- a/src/components/views/elements/RoomAliasField.tsx +++ b/src/components/views/elements/RoomAliasField.tsx @@ -77,7 +77,7 @@ export default class RoomAliasField extends React.PureComponent return { prefix, postfix, value, maxlength }; } - public render(): JSX.Element { + public render(): React.ReactNode { const { prefix, postfix, value, maxlength } = this.domainProps; return ( { ); }; - public render(): JSX.Element { + public render(): React.ReactNode { const canChange = SettingsStore.canSetValue(this.props.name, this.props.roomId, this.props.level); if (!canChange && this.props.hideIfCannotSet) return null; diff --git a/src/components/views/elements/SpellCheckLanguagesDropdown.tsx b/src/components/views/elements/SpellCheckLanguagesDropdown.tsx index a930ec409b..f4fd7fe9dc 100644 --- a/src/components/views/elements/SpellCheckLanguagesDropdown.tsx +++ b/src/components/views/elements/SpellCheckLanguagesDropdown.tsx @@ -91,7 +91,7 @@ export default class SpellCheckLanguagesDropdown extends React.Component< this.setState({ searchQuery }); } - public render(): JSX.Element { + public render(): React.ReactNode { if (this.state.languages === null) { return ; } diff --git a/src/components/views/elements/Spinner.tsx b/src/components/views/elements/Spinner.tsx index 30b75bfc94..cd65b63014 100644 --- a/src/components/views/elements/Spinner.tsx +++ b/src/components/views/elements/Spinner.tsx @@ -30,7 +30,7 @@ export default class Spinner extends React.PureComponent { h: 32, }; - public render(): JSX.Element { + public render(): React.ReactNode { const { w, h, message } = this.props; return (
    diff --git a/src/components/views/elements/Spoiler.tsx b/src/components/views/elements/Spoiler.tsx index 839272451b..5cc28bd7d4 100644 --- a/src/components/views/elements/Spoiler.tsx +++ b/src/components/views/elements/Spoiler.tsx @@ -42,7 +42,7 @@ export default class Spoiler extends React.Component { this.setState({ visible: !this.state.visible }); }; - public render(): JSX.Element { + public render(): React.ReactNode { const reason = this.props.reason ? ( {"(" + this.props.reason + ")"} ) : null; diff --git a/src/components/views/elements/StyledCheckbox.tsx b/src/components/views/elements/StyledCheckbox.tsx index 5f753394f6..d2fb974dbe 100644 --- a/src/components/views/elements/StyledCheckbox.tsx +++ b/src/components/views/elements/StyledCheckbox.tsx @@ -44,7 +44,7 @@ export default class StyledCheckbox extends React.PureComponent this.id = this.props.id || "checkbox_" + randomString(10); } - public render(): JSX.Element { + public render(): React.ReactNode { /* eslint @typescript-eslint/no-unused-vars: ["error", { "ignoreRestSiblings": true }] */ const { children, className, kind = CheckboxStyle.Solid, inputRef, ...otherProps } = this.props; diff --git a/src/components/views/elements/StyledRadioButton.tsx b/src/components/views/elements/StyledRadioButton.tsx index 0b7ff491ef..6634cea75f 100644 --- a/src/components/views/elements/StyledRadioButton.tsx +++ b/src/components/views/elements/StyledRadioButton.tsx @@ -34,7 +34,7 @@ export default class StyledRadioButton extends React.PureComponent { - public render(): JSX.Element { + public render(): React.ReactNode { const { children: content, language } = this.props; const highlighted = language ? hljs.highlight(content, { language }) : hljs.highlightAuto(content); diff --git a/src/components/views/elements/TagComposer.tsx b/src/components/views/elements/TagComposer.tsx index 88add4c962..0fdd5e98cd 100644 --- a/src/components/views/elements/TagComposer.tsx +++ b/src/components/views/elements/TagComposer.tsx @@ -65,7 +65,7 @@ export default class TagComposer extends React.PureComponent { this.props.onRemove(tag); } - public render(): JSX.Element { + public render(): React.ReactNode { return (
    diff --git a/src/components/views/elements/TextWithTooltip.tsx b/src/components/views/elements/TextWithTooltip.tsx index f009f8c526..e54ed077c5 100644 --- a/src/components/views/elements/TextWithTooltip.tsx +++ b/src/components/views/elements/TextWithTooltip.tsx @@ -32,7 +32,7 @@ export default class TextWithTooltip extends React.Component { super(props); } - public render(): JSX.Element { + public render(): React.ReactNode { const { class: className, children, tooltip, tooltipClass, tooltipProps, ...props } = this.props; return ( diff --git a/src/components/views/elements/Tooltip.tsx b/src/components/views/elements/Tooltip.tsx index 5e65824454..98ee56b159 100644 --- a/src/components/views/elements/Tooltip.tsx +++ b/src/components/views/elements/Tooltip.tsx @@ -174,7 +174,7 @@ export default class Tooltip extends React.PureComponent { this.setState(style); }; - public render(): JSX.Element { + public render(): React.ReactNode { const tooltipClasses = classNames("mx_Tooltip", this.props.tooltipClassName, { mx_Tooltip_visible: this.props.visible, mx_Tooltip_invisible: !this.props.visible, diff --git a/src/components/views/elements/TooltipButton.tsx b/src/components/views/elements/TooltipButton.tsx index ceb547a9ce..f05a83474f 100644 --- a/src/components/views/elements/TooltipButton.tsx +++ b/src/components/views/elements/TooltipButton.tsx @@ -28,7 +28,7 @@ export default class TooltipButton extends React.Component { super(props); } - public render(): JSX.Element { + public render(): React.ReactNode { return ( { } } - public render(): JSX.Element { + public render(): React.ReactNode { let overflowNode = null; const totalChildren = this.getChildCount(); diff --git a/src/components/views/elements/crypto/VerificationQRCode.tsx b/src/components/views/elements/crypto/VerificationQRCode.tsx index 6f8c9c7411..f19b9613a2 100644 --- a/src/components/views/elements/crypto/VerificationQRCode.tsx +++ b/src/components/views/elements/crypto/VerificationQRCode.tsx @@ -24,7 +24,7 @@ interface IProps { } export default class VerificationQRCode extends React.PureComponent { - public render(): JSX.Element { + public render(): React.ReactNode { return ( { ); }; - public render(): JSX.Element { + public render(): React.ReactNode { const { emojis, name, heightBefore, viewportHeight, scrollTop } = this.props; if (!emojis || emojis.length === 0) { return null; diff --git a/src/components/views/emojipicker/Emoji.tsx b/src/components/views/emojipicker/Emoji.tsx index 4dd6219fa6..022c29a94a 100644 --- a/src/components/views/emojipicker/Emoji.tsx +++ b/src/components/views/emojipicker/Emoji.tsx @@ -30,7 +30,7 @@ interface IProps { } class Emoji extends React.PureComponent { - public render(): JSX.Element { + public render(): React.ReactNode { const { onClick, onMouseEnter, onMouseLeave, emoji, selectedEmojis } = this.props; const isSelected = selectedEmojis && selectedEmojis.has(emoji.unicode); return ( diff --git a/src/components/views/emojipicker/EmojiPicker.tsx b/src/components/views/emojipicker/EmojiPicker.tsx index 7a99d4fa2c..2e4a6dc0de 100644 --- a/src/components/views/emojipicker/EmojiPicker.tsx +++ b/src/components/views/emojipicker/EmojiPicker.tsx @@ -249,7 +249,7 @@ class EmojiPicker extends React.Component { return CATEGORY_HEADER_HEIGHT + Math.ceil(count / EMOJIS_PER_ROW) * EMOJI_HEIGHT; } - public render(): JSX.Element { + public render(): React.ReactNode { let heightBefore = 0; return (
    diff --git a/src/components/views/emojipicker/Header.tsx b/src/components/views/emojipicker/Header.tsx index 68aa028336..995e2291e8 100644 --- a/src/components/views/emojipicker/Header.tsx +++ b/src/components/views/emojipicker/Header.tsx @@ -82,7 +82,7 @@ class Header extends React.PureComponent { } }; - public render(): JSX.Element { + public render(): React.ReactNode { return (