diff --git a/types/react/index.d.ts b/types/react/index.d.ts index 97adab18d4..f7b7310d7d 100644 --- a/types/react/index.d.ts +++ b/types/react/index.d.ts @@ -468,7 +468,7 @@ declare namespace React { type FC
= FunctionComponent
; interface FunctionComponent
{ - (props: P & { children?: ReactNode }, context?: any): ReactElement | null; + (props: PropsWithChildren
, context?: any): ReactElement | null; propTypes?: WeakValidationMap
;
contextTypes?: ValidationMap ;
@@ -476,7 +476,7 @@ declare namespace React {
}
interface RefForwardingComponent , ref: Ref ;
contextTypes?: ValidationMap ;
@@ -722,6 +722,8 @@ declare namespace React {
: P
: P;
+ type PropsWithChildren = P & { children?: ReactNode };
+
/**
* NOTE: prefer ComponentPropsWithRef, if the ref is forwarded,
* or ComponentPropsWithoutRef when refs are not supported.
@@ -747,7 +749,7 @@ declare namespace React {
function memo (
Component: SFC ,
- propsAreEqual?: (prevProps: Readonly , nextProps: Readonly ) => boolean
+ propsAreEqual?: (prevProps: Readonly ;
function memo