Fix RefForwardingComponent argument type. (#30373)

This commit is contained in:
Alexey Immoreev 2018-11-14 01:55:17 +03:00 committed by John Reilly
parent 31fc92ecd3
commit 0d49c9a4c6
2 changed files with 2 additions and 2 deletions

View File

@ -6,7 +6,7 @@ import * as ReactIs from 'react-is';
// Determining if a Component is Valid
interface CompProps {
forwardedRef?: React.Ref<any>;
forwardedRef: React.Ref<any> | null;
children?: React.ReactNode;
}

View File

@ -463,7 +463,7 @@ declare namespace React {
}
interface RefForwardingComponent<T, P = {}> {
(props: P & { children?: ReactNode }, ref?: Ref<T>): ReactElement<any> | null;
(props: P & { children?: ReactNode }, ref: Ref<T> | null): ReactElement<any> | null;
propTypes?: ValidationMap<P>;
contextTypes?: ValidationMap<any>;
defaultProps?: Partial<P>;