From b097136f744eada38e46586f7382210071f7b430 Mon Sep 17 00:00:00 2001 From: Ashoat Tevosyan Date: Wed, 7 Mar 2018 14:29:25 -0500 Subject: [PATCH] [Flow] Some updates, mostly from flow-typed (#3682) 1. Remove `NavigationComponent` from `NavigationScreenRouteConfig`. The only context `NavigationScreenRouteConfig` is used in is as an intersection with an object, and as such the only relevant portions of `NavigationScreenRouteConfig` are the object parts. 2. Add static `HEIGHT` variable to `Header` type. 3. In `NavigationContainerProps`, make `onNavigationStateChange` property value nullable. PS: if in the future you guys would prefer that I separate these sort of PRs into their constituent parts, let me know. --- flow/react-navigation.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/flow/react-navigation.js b/flow/react-navigation.js index 7c17862..15a9a4f 100644 --- a/flow/react-navigation.js +++ b/flow/react-navigation.js @@ -296,7 +296,6 @@ declare module 'react-navigation' { } & NavigationScreenRouteConfig); declare export type NavigationScreenRouteConfig = - | NavigationComponent | { screen: NavigationComponent, } @@ -883,7 +882,9 @@ declare module 'react-navigation' { }; declare export var SafeAreaView: React$ComponentType<_SafeAreaViewProps>; - declare export var Header: React$ComponentType; + declare export var Header: React$ComponentType & { + HEIGHT: number, + }; declare type _HeaderTitleProps = { children: React$Node,