diff --git a/react/index.d.ts b/react/index.d.ts index 9f9761cdcf..0b8bf70b6e 100644 --- a/react/index.d.ts +++ b/react/index.d.ts @@ -59,22 +59,22 @@ declare namespace React { // ---------------------------------------------------------------------- interface Factory
{ - (props?: P & Attributes, ...children: ReactNode[]): ReactElement
; + (props?: Attributes & P, ...children: ReactNode[]): ReactElement
; } interface SFCFactory
{ - (props?: P & Attributes, ...children: ReactNode[]): SFCElement
; + (props?: Attributes & P, ...children: ReactNode[]): SFCElement
; } interface ComponentFactory
> {
- (props?: P & ClassAttributes ;
+ (props?: ClassAttributes ;
}
type CFactory > = ComponentFactory ;
type ClassicFactory = CFactory >;
interface DOMFactory , T extends Element> {
- (props?: P & ClassAttributes ;
+ (props?: ClassAttributes ;
}
interface HTMLFactory , ClassicComponentClass >): CFactory >;
function createFactory , C extends ComponentClass >(
type: ClassType ): CFactory ;
- function createFactory (type: ComponentClass | SFC ): Factory ;
+ function createFactory (type: ComponentClass ): Factory ;
function createElement , T extends Element>(
type: string,
- props?: P & ClassAttributes ;
function createElement (
type: SFC ,
- props?: P & Attributes,
+ props?: Attributes & P,
...children: ReactNode[]): SFCElement ;
function createElement (
type: ClassType , ClassicComponentClass >,
- props?: P & ClassAttributes >;
function createElement , C extends ComponentClass >(
type: ClassType ,
- props?: P & ClassAttributes ;
function createElement (
- type: ComponentClass | SFC ,
- props?: P & Attributes,
+ type: ComponentClass ,
+ props?: Attributes & P,
...children: ReactNode[]): ReactElement ;
function cloneElement , T extends Element>(
element: DOMElement ,
- props?: P & ClassAttributes ;
function cloneElement (
element: SFCElement ,
@@ -175,7 +175,7 @@ declare namespace React {
// always pass children as variadic arguments to `createElement`.
// In the future, if we can define its call signature conditionally
// on the existence of `children` in `P`, then we should remove this.
- props: P & { children?: ReactNode };
+ props: { children?: ReactNode } & P;
state: S;
context: any;
refs: {