[flow] Fix type of getCurrentNavigation (#5173)

As of 2.18 we seem to be okay returning `null` here.
This commit is contained in:
Ashoat Tevosyan 2018-10-25 17:14:57 -04:00 committed by Brent Vatne
parent 352e703ea9
commit adcb2e5b4a

View File

@ -535,14 +535,26 @@ declare module 'react-navigation' {
) => NavigationEventSubscription,
getParam: <ParamName>(
paramName: ParamName,
fallback?: $ElementType<$PropertyType<{|
...{| params: {| [ParamName]: void |} |},
...$Exact<S>,
|}, 'params'>, ParamName>,
) => $ElementType<$PropertyType<{|
...{| params: {| [ParamName]: void |} |},
...$Exact<S>,
|}, 'params'>, ParamName>,
fallback?: $ElementType<
$PropertyType<
{|
...{| params: {| [ParamName]: void |} |},
...$Exact<S>,
|},
'params'
>,
ParamName
>
) => $ElementType<
$PropertyType<
{|
...{| params: {| [ParamName]: void |} |},
...$Exact<S>,
|},
'params'
>,
ParamName
>,
dangerouslyGetParent: () => NavigationScreenProp<*>,
isFocused: () => boolean,
// Shared action creators that exist for all routers
@ -1213,6 +1225,6 @@ declare module 'react-navigation' {
dispatch: NavigationDispatch,
actionSubscribers: Set<NavigationEventCallback>,
getScreenProps: () => {},
getCurrentNavigation: () => NavigationScreenProp<State>
getCurrentNavigation: () => ?NavigationScreenProp<State>
): NavigationScreenProp<State>;
}