From e3fdd2698a14f090bedf52def2a1d3192daff32a Mon Sep 17 00:00:00 2001 From: Habibi Date: Sat, 13 May 2017 19:10:05 +0700 Subject: [PATCH 1/3] =?UTF-8?q?Fix=20react-navigation=20typo=20=E2=80=9Cta?= =?UTF-8?q?bBarLabel=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/react-navigation/index.d.ts | 2 +- types/react-navigation/react-navigation-tests.tsx | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index 6b263642ff..cf510e4cd1 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -585,7 +585,7 @@ export interface TabNavigatorScreenOptions { title?: string; tabBarVisible?: boolean; tabBarIcon?: React.ReactElement; - tabBarLaben?: string + tabBarLabel?: string |React.ReactElement | ((options: {focused: boolean, tintColor: string}) => React.ReactElement) ; diff --git a/types/react-navigation/react-navigation-tests.tsx b/types/react-navigation/react-navigation-tests.tsx index d01ae62640..6182dfd64c 100644 --- a/types/react-navigation/react-navigation-tests.tsx +++ b/types/react-navigation/react-navigation-tests.tsx @@ -28,3 +28,10 @@ const Router = (props: any) => ( } /> ); + +const tabNavigatorScreenOptions: TabNavigatorScreenOptions = { + title: 'title', + tabBarVisible: true, + tabBarIcon: , + tabBarLabel: 'label' +} From a58b6330a57a0fb4277085b527013b4cc3660e55 Mon Sep 17 00:00:00 2001 From: Habibi Date: Sat, 13 May 2017 19:24:05 +0700 Subject: [PATCH 2/3] react-navigation Add different typing for tabBarIcon --- types/react-navigation/index.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index cf510e4cd1..ddbe9b11e3 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -584,11 +584,11 @@ export interface StackNavigatorScreenOptions { export interface TabNavigatorScreenOptions { title?: string; tabBarVisible?: boolean; - tabBarIcon?: React.ReactElement; + tabBarIcon?: React.ReactElement + | ((options: { focused: boolean, tintColor: string }) => React.ReactElement); tabBarLabel?: string - |React.ReactElement - | ((options: {focused: boolean, tintColor: string}) => React.ReactElement) - ; + | React.ReactElement + | ((options: { focused: boolean, tintColor: string }) => React.ReactElement); } export interface DrawerNavigatorScreenOptions { From 1cfe9350bbc174d957c263c7eb2a39c206af7cba Mon Sep 17 00:00:00 2001 From: Habibi Date: Sat, 13 May 2017 19:58:36 +0700 Subject: [PATCH 3/3] Fix missing import in the test --- types/react-navigation/react-navigation-tests.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/types/react-navigation/react-navigation-tests.tsx b/types/react-navigation/react-navigation-tests.tsx index 6182dfd64c..a88a5d3a0b 100644 --- a/types/react-navigation/react-navigation-tests.tsx +++ b/types/react-navigation/react-navigation-tests.tsx @@ -3,6 +3,7 @@ import { View } from 'react-native'; import { addNavigationHelpers, StackNavigator, + TabNavigatorScreenOptions } from 'react-navigation'; const Start = (