Skip to content

Commit 2cf5725

Browse files
Ashoatsourcecode911
authored andcommitted
[Flow] Some updates, mostly from flow-typed (react-navigation#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.
1 parent 812df28 commit 2cf5725

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

flow/react-navigation.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,6 @@ declare module 'react-navigation' {
296296
} & NavigationScreenRouteConfig);
297297

298298
declare export type NavigationScreenRouteConfig =
299-
| NavigationComponent
300299
| {
301300
screen: NavigationComponent,
302301
}
@@ -883,7 +882,9 @@ declare module 'react-navigation' {
883882
};
884883
declare export var SafeAreaView: React$ComponentType<_SafeAreaViewProps>;
885884

886-
declare export var Header: React$ComponentType<HeaderProps>;
885+
declare export var Header: React$ComponentType<HeaderProps> & {
886+
HEIGHT: number,
887+
};
887888

888889
declare type _HeaderTitleProps = {
889890
children: React$Node,

0 commit comments

Comments
 (0)