Skip to content

Commit

Permalink
[flow] Fix NavigationScreenProp.getParam type (#5830)
Browse files Browse the repository at this point in the history
In my last PR I flipped the order of these around to fix an error, but turns out that was just crippling the type. The correct solution here, to guarantee that the `$PropertyType` won't error if its type parameter don't have the property, is to use an unsealed object type.

Some additional context in discussion on #5806.
  • Loading branch information
Ashoat authored and brentvatne committed Apr 19, 2019
1 parent 3f8a4d4 commit cd22810
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions flow/react-navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -588,8 +588,8 @@ declare module 'react-navigation' {
fallback?: $ElementType<
$PropertyType<
{|
...{| params: {} |},
...$Exact<S>,
...{| params: {| [ParamName]: void |} |},
|},
'params'
>,
Expand All @@ -598,8 +598,8 @@ declare module 'react-navigation' {
) => $ElementType<
$PropertyType<
{|
...{| params: {} |},
...$Exact<S>,
...{| params: {| [ParamName]: void |} |},
|},
'params'
>,
Expand Down

0 comments on commit cd22810

Please sign in to comment.