Apply strictNullChecks to src/components/views/emojipicker/* (#10298)

This commit is contained in:
Michael Telatynski 2023-03-07 11:28:48 +00:00 committed by GitHub
parent 1b806bb47b
commit 2191a2d820
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 10 deletions

View file

@ -29,7 +29,7 @@ interface IProps {
}
class Header extends React.PureComponent<IProps> {
private findNearestEnabled(index: number, delta: number): number {
private findNearestEnabled(index: number, delta: number): number | undefined {
index += this.props.categories.length;
const cats = [...this.props.categories, ...this.props.categories, ...this.props.categories];
@ -45,10 +45,10 @@ class Header extends React.PureComponent<IProps> {
}
private changeCategoryAbsolute(index: number, delta = 1): void {
const category = this.props.categories[this.findNearestEnabled(index, delta)];
const category = this.props.categories[this.findNearestEnabled(index, delta)!];
if (category) {
this.props.onAnchorClick(category.id);
category.ref.current.focus();
category.ref.current?.focus();
}
}