Conform more of the code base to strict null checking (#10147)
* Conform more of the code base to strict null checking * More strict fixes * More strict work * Fix missing optional type * Iterate
This commit is contained in:
parent
fa036a5080
commit
da7aa4055e
380 changed files with 682 additions and 694 deletions
|
@ -69,7 +69,7 @@ class Category extends React.PureComponent<IProps> {
|
|||
);
|
||||
};
|
||||
|
||||
public render(): JSX.Element {
|
||||
public render(): React.ReactNode {
|
||||
const { emojis, name, heightBefore, viewportHeight, scrollTop } = this.props;
|
||||
if (!emojis || emojis.length === 0) {
|
||||
return null;
|
||||
|
|
|
@ -30,7 +30,7 @@ interface IProps {
|
|||
}
|
||||
|
||||
class Emoji extends React.PureComponent<IProps> {
|
||||
public render(): JSX.Element {
|
||||
public render(): React.ReactNode {
|
||||
const { onClick, onMouseEnter, onMouseLeave, emoji, selectedEmojis } = this.props;
|
||||
const isSelected = selectedEmojis && selectedEmojis.has(emoji.unicode);
|
||||
return (
|
||||
|
|
|
@ -249,7 +249,7 @@ class EmojiPicker extends React.Component<IProps, IState> {
|
|||
return CATEGORY_HEADER_HEIGHT + Math.ceil(count / EMOJIS_PER_ROW) * EMOJI_HEIGHT;
|
||||
}
|
||||
|
||||
public render(): JSX.Element {
|
||||
public render(): React.ReactNode {
|
||||
let heightBefore = 0;
|
||||
return (
|
||||
<div className="mx_EmojiPicker" data-testid="mx_EmojiPicker">
|
||||
|
|
|
@ -82,7 +82,7 @@ class Header extends React.PureComponent<IProps> {
|
|||
}
|
||||
};
|
||||
|
||||
public render(): JSX.Element {
|
||||
public render(): React.ReactNode {
|
||||
return (
|
||||
<nav
|
||||
className="mx_EmojiPicker_header"
|
||||
|
|
|
@ -24,7 +24,7 @@ interface IProps {
|
|||
}
|
||||
|
||||
class Preview extends React.PureComponent<IProps> {
|
||||
public render(): JSX.Element {
|
||||
public render(): React.ReactNode {
|
||||
const {
|
||||
unicode,
|
||||
label,
|
||||
|
|
|
@ -59,7 +59,7 @@ class QuickReactions extends React.Component<IProps, IState> {
|
|||
});
|
||||
};
|
||||
|
||||
public render(): JSX.Element {
|
||||
public render(): React.ReactNode {
|
||||
return (
|
||||
<section className="mx_EmojiPicker_footer mx_EmojiPicker_quick mx_EmojiPicker_category">
|
||||
<h2 className="mx_EmojiPicker_quick_header mx_EmojiPicker_category_label">
|
||||
|
|
|
@ -130,7 +130,7 @@ class ReactionPicker extends React.Component<IProps, IState> {
|
|||
return true;
|
||||
};
|
||||
|
||||
public render(): JSX.Element {
|
||||
public render(): React.ReactNode {
|
||||
return (
|
||||
<EmojiPicker
|
||||
onChoose={this.onChoose}
|
||||
|
|
|
@ -46,7 +46,7 @@ class Search extends React.PureComponent<IProps> {
|
|||
}
|
||||
};
|
||||
|
||||
public render(): JSX.Element {
|
||||
public render(): React.ReactNode {
|
||||
let rightButton;
|
||||
if (this.props.query) {
|
||||
rightButton = (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue