diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index 10c398bf34..23e02b8ff9 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -1273,17 +1273,17 @@ export interface NavigationInjectedProps

{ } // If the wrapped component is a class, we can get a ref to it -export function withNavigation>( - Component: T, -): React.ComponentType, keyof NavigationInjectedProps> & { onRef?: React.Ref> }>; +export function withNavigation

>( + Component: T & React.ComponentClass

, +): React.ComponentType & { onRef?: React.Ref> }>; -export function withNavigation>( - Component: T, -): React.ComponentType, keyof NavigationInjectedProps>>; +export function withNavigation

( + Component: React.ComponentType

, +): React.ComponentType>; // For backwards compatibility export function withNavigation( - Component: React.ComponentType)>, + Component: React.ComponentType>, ): React.ComponentType>> }>; export interface NavigationFocusInjectedProps

extends NavigationInjectedProps

{ @@ -1291,13 +1291,13 @@ export interface NavigationFocusInjectedProps

extends Navi } // If the wrapped component is a class, we can get a ref to it -export function withNavigationFocus>( - Component: T, -): React.ComponentType, keyof NavigationFocusInjectedProps> & { onRef?: React.Ref> }>; +export function withNavigationFocus

>( + Component: T & React.ComponentClass

, +): React.ComponentType & { onRef?: React.Ref> }>; -export function withNavigationFocus>( - Component: T, -): React.ComponentType, keyof NavigationFocusInjectedProps>>; +export function withNavigationFocus

( + Component: React.ComponentType

, +): React.ComponentType>; // For backwards compatibility export function withNavigationFocus( diff --git a/types/react-navigation/react-navigation-tests.tsx b/types/react-navigation/react-navigation-tests.tsx index 116ae92c56..64cfffbf7d 100644 --- a/types/react-navigation/react-navigation-tests.tsx +++ b/types/react-navigation/react-navigation-tests.tsx @@ -413,14 +413,14 @@ class CustomTransitioner extends React.Component /> ); } - _render = (props: NavigationTransitionProps, prevProps: NavigationTransitionProps): React.ReactElement => { + _render = (props: NavigationTransitionProps, prevProps?: NavigationTransitionProps): React.ReactElement => { return ( ); } _configureTransition = ( _transitionProps: NavigationTransitionProps, - _prevTransitionProps: NavigationTransitionProps + _prevTransitionProps?: NavigationTransitionProps ) => { return {}; } diff --git a/types/react-navigation/tsconfig.json b/types/react-navigation/tsconfig.json index b0cf7029db..bc49bee237 100644 --- a/types/react-navigation/tsconfig.json +++ b/types/react-navigation/tsconfig.json @@ -7,7 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, - "strictFunctionTypes": false, + "strictFunctionTypes": true, "baseUrl": "../", "jsx": "react", "typeRoots": [