this.subscription.unsubscribe();
}
- static getDerivedStateFromProps(props: any): HomeProps {
+ static getDerivedStateFromProps(
+ props: HomeProps,
+ state: HomeState
+ ): HomeProps {
return {
- listingType: getListingTypeFromProps(props, ListingType.Local),
+ listingType: getListingTypeFromProps(props, state.listingType),
dataType: getDataTypeFromProps(props),
sort: getSortTypeFromProps(props),
page: getPageFromProps(props),
: ListingType.Local;
}
-// TODO might need to add a user setting for this too
export function getDataTypeFromProps(props: any): DataType {
return props.match.params.data_type
? routeDataTypeToEnum(props.match.params.data_type)