1
0
mirror of https://github.com/SomboChea/ui synced 2024-11-05 06:04:28 +07:00

Merge pull request #79 from griffithtp/refactor/typescript-warning-withRoute

fix: @typescript-eslint/no-explicit-any
This commit is contained in:
Juan Picado @jotadeveloper 2019-06-30 22:18:23 +02:00 committed by GitHub
commit 4746f4070c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,5 @@
import React, { Component, Fragment, ReactElement } from 'react';
import { withRouter, RouteProps } from 'react-router-dom';
import { withRouter, RouteComponentProps } from 'react-router-dom';
import CardContent from '@material-ui/core/CardContent';
import { DetailContextConsumer, VersionPageConsumerProps } from '../../pages/version/Version';
@ -7,18 +7,18 @@ import { DetailContextConsumer, VersionPageConsumerProps } from '../../pages/ver
import { CardWrap, Heading, Tags, Tag } from './styles';
import NoItems from '../NoItems';
interface DepDetailProps {
type DepDetailProps = {
name: string;
version: string;
onLoading: () => void;
history: string[];
}
onLoading?: () => void;
} & RouteComponentProps;
interface DepDetailState {
name: string;
version: string;
}
class DepDetail extends Component<DepDetailProps & RouteProps, DepDetailState> {
class DepDetail extends Component<DepDetailProps, DepDetailState> {
constructor(props: DepDetailProps) {
super(props);
const { name, version } = this.props;
@ -39,12 +39,12 @@ class DepDetail extends Component<DepDetailProps & RouteProps, DepDetailState> {
const { name } = this.state;
const { onLoading, history } = this.props;
onLoading();
onLoading && onLoading();
history.push(`/-/web/detail/${name}`);
};
}
const WrapperDependencyDetail = withRouter<any>(DepDetail);
const WrapperDependencyDetail = withRouter(DepDetail);
class DependencyBlock extends Component<{ title: string; dependencies: [] }> {
public render(): ReactElement<HTMLElement> {