React.SFC<...> | React.ComponentClass<...> => React.ComponentType<...>

This commit is contained in:
Tanguy Krotoff 2017-06-29 13:31:52 +02:00
parent 4d12d79360
commit 51e7287c86
3 changed files with 4 additions and 4 deletions

View File

@ -14,7 +14,7 @@ export interface RouteConfigComponentProps<T> extends RouteComponentProps<T> {
export interface RouteConfig {
location?: Location;
component?: React.SFC<RouteConfigComponentProps<any> | void> | React.ComponentClass<RouteConfigComponentProps<any> | void>;
component?: React.ComponentType<RouteConfigComponentProps<any> | void>;
path?: string;
exact?: boolean;
strict?: boolean;

View File

@ -64,7 +64,7 @@ export interface RouteComponentProps<P> {
export interface RouteProps {
location?: H.Location;
component?: React.SFC<RouteComponentProps<any> | undefined> | React.ComponentClass<RouteComponentProps<any> | undefined>;
component?: React.ComponentType<RouteComponentProps<any> | undefined>;
render?: ((props: RouteComponentProps<any>) => React.ReactNode);
children?: ((props: RouteComponentProps<any>) => React.ReactNode) | React.ReactNode;
path?: string;
@ -99,4 +99,4 @@ export interface match<P> {
}
export function matchPath<P>(pathname: string, props: RouteProps): match<P> | null;
export function withRouter<P>(component: React.SFC<RouteComponentProps<any> & P> | React.ComponentClass<RouteComponentProps<any> & P>): React.ComponentClass<P>;
export function withRouter<P>(component: React.ComponentType<RouteComponentProps<any> & P>): React.ComponentClass<P>;

View File

@ -22,7 +22,7 @@ export interface WithScrollOptions {
alignToTop?: boolean;
}
export type ComponentConstructor<Props> = React.ComponentClass<Props> | React.SFC<Props>;
export type ComponentConstructor<Props> = React.ComponentType<Props>;
export function withScroll(component: ComponentConstructor<RouteComponentProps<any> | undefined>, options?: WithScrollOptions)
: ComponentConstructor<RouteComponentProps<any> | undefined>;