mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-02-09 22:51:57 +08:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user