]> Untitled Git - lemmy-ui.git/blobdiff - src/shared/components/common/listing-type-select.tsx
Use http client (#1081)
[lemmy-ui.git] / src / shared / components / common / listing-type-select.tsx
index abafe3752e88b18d0be490cd23b662db66a37fac..3e534d341c86056954ae61416d0136191e1e03a7 100644 (file)
@@ -8,7 +8,7 @@ interface ListingTypeSelectProps {
   type_: ListingType;
   showLocal: boolean;
   showSubscribed: boolean;
-  onChange?(val: ListingType): any;
+  onChange(val: ListingType): void;
 }
 
 interface ListingTypeSelectState {
@@ -29,11 +29,11 @@ export class ListingTypeSelect extends Component<
     super(props, context);
   }
 
-  static getDerivedStateFromProps(props: any): ListingTypeSelectProps {
+  static getDerivedStateFromProps(
+    props: ListingTypeSelectProps
+  ): ListingTypeSelectState {
     return {
       type_: props.type_,
-      showLocal: props.showLocal,
-      showSubscribed: props.showSubscribed,
     };
   }
 
@@ -97,6 +97,6 @@ export class ListingTypeSelect extends Component<
   }
 
   handleTypeChange(i: ListingTypeSelect, event: any) {
-    i.props.onChange?.(event.target.value);
+    i.props.onChange(event.target.value);
   }
 }