[flow] Update withNavigation and withNavigationFocus to support defaultProps (#5398)

This commit is contained in:
Levi Buzolic
2019-01-03 14:42:12 +11:00
parent af86f113a9
commit b015d5362d
2 changed files with 8 additions and 6 deletions

View File

@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## [Unreleased]
- Update flow definition for `withNavigation` and `withNavigationFocus` to support `defaultProps`
## [3.0.9] - [2018-12-19](https://github.com/react-navigation/react-navigation/releases/tag/3.0.9)
## Fixed

View File

@@ -1208,19 +1208,19 @@ declare module 'react-navigation' {
};
declare export var TabBarBottom: React$ComponentType<_TabBarBottomProps>;
declare export function withNavigation<Props: {}>(
Component: React$ComponentType<Props>
declare export function withNavigation<Props: {}, ComponentType: React$ComponentType<Props>>(
Component: ComponentType
): React$ComponentType<
$Diff<
Props,
React$ElementConfig<ComponentType>,
{
navigation: NavigationScreenProp<NavigationStateRoute> | void,
}
>
>;
declare export function withNavigationFocus<Props: {}>(
Component: React$ComponentType<Props>
): React$ComponentType<$Diff<Props, { isFocused: boolean | void }>>;
declare export function withNavigationFocus<Props: {}, ComponentType: React$ComponentType<Props>>(
Component: ComponentType
): React$ComponentType<$Diff<React$ElementConfig<ComponentType>, { isFocused: boolean | void }>>;
declare export function getNavigation<State: NavigationState, Options: {}>(
router: NavigationRouter<State, Options>,