diff --git a/packages/react-navigation/flow/react-navigation.js b/packages/react-navigation/flow/react-navigation.js index 08f46ea8..b4e81522 100644 --- a/packages/react-navigation/flow/react-navigation.js +++ b/packages/react-navigation/flow/react-navigation.js @@ -353,12 +353,8 @@ declare module 'react-navigation' { declare export type NavigationScreenComponent< Route: NavigationRoute, Options: {}, - Props: {} - > = React$ComponentType<{ - ...Props, - ...NavigationNavigatorProps, - }> & - withOptionalNavigationOptions; + Props: NavigationNavigatorProps + > = React$ComponentType & withOptionalNavigationOptions; declare interface withRouter { router: NavigationRouter; @@ -367,11 +363,8 @@ declare module 'react-navigation' { declare export type NavigationNavigator< State: NavigationState, Options: {}, - Props: {} - > = React$StatelessFunctionalComponent<{ - ...Props, - ...NavigationNavigatorProps, - }> & + Props: NavigationNavigatorProps + > = React$ComponentType & withRouter & withOptionalNavigationOptions; @@ -463,8 +456,14 @@ declare module 'react-navigation' { prevTransitionProps: ?NavigationTransitionProps, isModal: boolean ) => TransitionConfig, - onTransitionStart?: () => void, - onTransitionEnd?: () => void, + onTransitionStart?: ( + transitionProps: NavigationTransitionProps, + prevTransitionProps: ?NavigationTransitionProps + ) => void, + onTransitionEnd?: ( + transitionProps: NavigationTransitionProps, + prevTransitionProps: ?NavigationTransitionProps + ) => void, transparentCard?: boolean, disableKeyboardHandling?: boolean, |}; @@ -589,8 +588,8 @@ declare module 'react-navigation' { fallback?: $ElementType< $PropertyType< {| - ...{| params: {| [ParamName]: void |} |}, ...$Exact, + ...{| params: {| [ParamName]: void |} |}, |}, 'params' >, @@ -599,14 +598,14 @@ declare module 'react-navigation' { ) => $ElementType< $PropertyType< {| - ...{| params: {| [ParamName]: void |} |}, ...$Exact, + ...{| params: {| [ParamName]: void |} |}, |}, 'params' >, ParamName >, - dangerouslyGetParent: () => NavigationScreenProp<*>, + dangerouslyGetParent: () => ?NavigationScreenProp, isFocused: () => boolean, // Shared action creators that exist for all routers goBack: (routeKey?: ?string) => boolean, @@ -672,11 +671,8 @@ declare module 'react-navigation' { declare export type NavigationContainer< State: NavigationState, Options: {}, - Props: {} - > = React$ComponentType<{ - ...Props, - ...NavigationContainerProps, - }> & + Props: NavigationContainerProps + > = React$ComponentType & withRouter & withOptionalNavigationOptions; @@ -936,6 +932,7 @@ declare module 'react-navigation' { declare type NavigationView = React$ComponentType<{ descriptors: { [key: string]: NavigationDescriptor }, navigation: NavigationScreenProp, + navigationConfig: *, }>; declare export function createNavigator(