Skip to content

Commit 320ee08

Browse files
author
bdoss
committed
Use ComponentType for more flexibility.
1 parent 903ca10 commit 320ee08

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import * as React from 'react';
44
* The configuration for an asynchronous component.
55
*/
66
export interface Configuration<P> {
7-
resolve: () => Promise<React.Component<P>>;
7+
resolve: () => Promise<React.ComponentType<P>>;
88
LoadingComponent?: (props: P) => JSX.Element;
99
ErrorComponent?: (props: P & { error: Error }) => JSX.Element;
1010
name?: string;
@@ -40,7 +40,7 @@ export interface Context {
4040
*
4141
* @param config The configuration to use for the asynchronous component.
4242
*/
43-
export function asyncComponent<T extends React.Component<P>, P>(config: Configuration<P>): React.ComponentClass<P>;
43+
export function asyncComponent<P>(config: Configuration<P>): React.ComponentType<P>;
4444

4545
/**
4646
* Create a context for the asynchronous component resolving module.

0 commit comments

Comments
 (0)