Apply strictNullChecks
to src/components/views/emojipicker/* (#10298)
This commit is contained in:
parent
1b806bb47b
commit
2191a2d820
4 changed files with 11 additions and 10 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue