fix: wrong type in react-navigation.d.ts (#6486)

This code is actually throwing a type error because of a wrong type declaration with the action expecting to be only a `NavigationNavigateAction` while in reality any action can be dispatched not only the `navigate`.
```jsx
      StackActions.replace({
        routeName: 'MyRoute1',
        // this action is throwing a type error
        action: StackActions.push({
          routeName: 'MyRoute2',
        }),
      }),
```
This commit is contained in:
Mattia Asti
2020-01-23 14:40:08 +00:00
parent 1c30ac07e4
commit 0189ff4eb3

View File

@@ -291,7 +291,7 @@ declare module 'react-navigation' {
newKey?: string;
routeName: string;
params?: NavigationParams;
action?: NavigationNavigateAction;
action?: NavigationAction;
}
export interface NavigationReplaceAction {
@@ -299,7 +299,7 @@ declare module 'react-navigation' {
key: string;
routeName: string;
params?: NavigationParams;
action?: NavigationNavigateAction;
action?: NavigationAction;
}
export interface NavigationCompleteTransitionActionPayload {