From 5ecba055105e3e96246eeb1895d5c9e019cebd14 Mon Sep 17 00:00:00 2001 From: Omar Diab Date: Wed, 20 Jun 2018 20:19:07 -0700 Subject: [PATCH] update withNavigation types, add test --- types/react-navigation/index.d.ts | 2 +- .../react-navigation-tests.tsx | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index 332f4e4645..0c67c333a0 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -1162,7 +1162,7 @@ export interface NavigationInjectedProps { export function withNavigation( Component: React.ComponentType -): React.ComponentType; +): React.ComponentType }>; export function withNavigationFocus( Component: React.ComponentType diff --git a/types/react-navigation/react-navigation-tests.tsx b/types/react-navigation/react-navigation-tests.tsx index 03b6f76775..38aa495240 100644 --- a/types/react-navigation/react-navigation-tests.tsx +++ b/types/react-navigation/react-navigation-tests.tsx @@ -40,6 +40,8 @@ import { NavigationPopToTopAction, NavigationScreenComponent, NavigationContainerComponent, + withNavigation, + NavigationInjectedProps, } from 'react-navigation'; // Constants @@ -514,3 +516,19 @@ class SetParamsTest extends React.Component> ); } } + +// Test withNavigation + +interface BackButtonProps { title: string; } +class MyBackButton extends React.Component { + render() { + return