From fa04697ee1fc62a8cbfe1c5f3998fe903812b399 Mon Sep 17 00:00:00 2001 From: ArmandoAssuncao Date: Fri, 2 Mar 2018 23:07:22 -0300 Subject: [PATCH] [react-navigation]: added types in navigate params --- types/react-navigation/index.d.ts | 5 +++-- types/react-navigation/react-navigation-tests.tsx | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index c4e396783f..b6897b11c8 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -14,6 +14,7 @@ // Veit Lehmann: // Roberto Huertas: // Steven Miller +// Armando Assuncao // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 @@ -396,13 +397,13 @@ export interface NavigationEventSubscription { remove: () => void; } -export interface NavigationScreenProp { +export interface NavigationScreenProp { state: S; dispatch: NavigationDispatch; goBack: (routeKey?: (string | null)) => boolean; navigate: ( routeName: string, - params?: NavigationParams, + params?: P, action?: NavigationAction ) => boolean; setParams: (newParams: NavigationParams) => boolean; diff --git a/types/react-navigation/react-navigation-tests.tsx b/types/react-navigation/react-navigation-tests.tsx index 017a9b9153..54489ba722 100644 --- a/types/react-navigation/react-navigation-tests.tsx +++ b/types/react-navigation/react-navigation-tests.tsx @@ -250,7 +250,7 @@ function renderBasicDrawerNavigator(): JSX.Element { } interface CustomTransitionerProps { - navigation: NavigationScreenProp; + navigation: NavigationScreenProp; } /** * @desc Custom transitioner component. Follows react-navigation/src/views/CardStackTransitioner.js.