interface SortSelectProps {
sort: SortType;
- onChange?(val: SortType): any;
+ onChange(val: SortType): void;
hideHot?: boolean;
hideMostComments?: boolean;
}
super(props, context);
}
- static getDerivedStateFromProps(props: any): SortSelectState {
+ static getDerivedStateFromProps(props: SortSelectProps): SortSelectState {
return {
sort: props.sort,
};
}
handleSortChange(i: SortSelect, event: any) {
- i.props.onChange?.(event.target.value);
+ i.props.onChange(event.target.value);
}
}