mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
remove React.ComponentElement<P> and rename Factory<P> to ComponentFactory<P>
This commit is contained in:
@@ -60,7 +60,7 @@ var reactClass: React.ComponentClass<Props> = React.createClass<Props>({
|
||||
var reactElement: React.ReactElement<Props> =
|
||||
React.createElement<Props>(reactClass, props);
|
||||
|
||||
var reactFactory: React.Factory<Props> =
|
||||
var reactFactory: React.ComponentFactory<Props> =
|
||||
React.createFactory<Props>(reactClass);
|
||||
|
||||
var component: React.Component<Props> =
|
||||
|
||||
Vendored
+4
-6
@@ -19,7 +19,6 @@ declare module React {
|
||||
|
||||
interface ReactHTMLElement extends ReactElement<HTMLAttributes> {}
|
||||
interface ReactSVGElement extends ReactElement<SVGAttributes> {}
|
||||
interface ComponentElement<P> extends ReactElement<P> {}
|
||||
|
||||
//
|
||||
// React Nodes
|
||||
@@ -49,13 +48,12 @@ declare module React {
|
||||
// ReactElement Factories
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
interface Factory<P> {
|
||||
interface ComponentFactory<P> {
|
||||
(props?: P, ...children: any/*ReactNode*/[]): ReactElement<P>;
|
||||
}
|
||||
|
||||
interface HTMLFactory extends Factory<HTMLAttributes> {}
|
||||
interface SVGFactory extends Factory<SVGAttributes> {}
|
||||
interface ComponentFactory<P> extends Factory<P> {}
|
||||
interface HTMLFactory extends ComponentFactory<HTMLAttributes> {}
|
||||
interface SVGFactory extends ComponentFactory<SVGAttributes> {}
|
||||
|
||||
//
|
||||
// Top-Level API
|
||||
@@ -64,7 +62,7 @@ declare module React {
|
||||
interface TopLevelAPI {
|
||||
createClass<P>(spec: ComponentSpec<P, any>): ComponentClass<P>;
|
||||
createElement<P>(type: any/*ReactType*/, props: P, ...children: any/*ReactNode*/[]): ReactElement<P>;
|
||||
createFactory<P>(componentClass: ComponentClass<P>): Factory<P>;
|
||||
createFactory<P>(componentClass: ComponentClass<P>): ComponentFactory<P>;
|
||||
render<P>(element: ReactElement<P>, container: Element, callback?: () => void): Component<P>;
|
||||
unmountComponentAtNode(container: Element): boolean;
|
||||
renderToString(element: ReactElement<any>): string;
|
||||
|
||||
Reference in New Issue
Block a user