Skip to content

Commit

Permalink
[flow] Fix type of getCurrentNavigation (#5173)
Browse files Browse the repository at this point in the history
As of 2.18 we seem to be okay returning `null` here.
  • Loading branch information
Ashoat authored and brentvatne committed Oct 25, 2018
1 parent 352e703 commit adcb2e5
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions flow/react-navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -1213,6 +1225,6 @@ declare module 'react-navigation' {
dispatch: NavigationDispatch,
actionSubscribers: Set<NavigationEventCallback>,
getScreenProps: () => {},
getCurrentNavigation: () => NavigationScreenProp<State>
getCurrentNavigation: () => ?NavigationScreenProp<State>
): NavigationScreenProp<State>;
}

0 comments on commit adcb2e5

Please sign in to comment.