[flow] Fix NavigationScreenProp.getParam type (#5830)

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.
This commit is contained in:
Ashoat Tevosyan
2019-04-18 21:12:31 -04:00
parent 02e0dad97c
commit 8cc6bcbf22

View File

@@ -588,8 +588,8 @@ declare module 'react-navigation' {
fallback?: $ElementType<
$PropertyType<
{|
...{| params: {} |},
...$Exact<S>,
...{| params: {| [ParamName]: void |} |},
|},
'params'
>,
@@ -598,8 +598,8 @@ declare module 'react-navigation' {
) => $ElementType<
$PropertyType<
{|
...{| params: {} |},
...$Exact<S>,
...{| params: {| [ParamName]: void |} |},
|},
'params'
>,