mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-04-29 12:55:21 +08:00
remove support for deprecated navigation actions (#3595)
* remove support for deprecated navigation actions * remove deprecated action from flow definitions
This commit is contained in:
committed by
Brent Vatne
parent
ab758bcaaa
commit
276fb8f7b3
59
flow/react-navigation.js
vendored
59
flow/react-navigation.js
vendored
@@ -71,25 +71,11 @@ declare module 'react-navigation' {
|
||||
key?: string,
|
||||
|};
|
||||
|
||||
declare type DeprecatedNavigationNavigateAction = {|
|
||||
type: 'Navigate',
|
||||
routeName: string,
|
||||
params?: NavigationParams,
|
||||
|
||||
// The action to run inside the sub-router
|
||||
action?: NavigationNavigateAction | DeprecatedNavigationNavigateAction,
|
||||
|};
|
||||
|
||||
declare export type NavigationBackAction = {|
|
||||
type: 'Navigation/BACK',
|
||||
key?: ?string,
|
||||
|};
|
||||
|
||||
declare type DeprecatedNavigationBackAction = {|
|
||||
type: 'Back',
|
||||
key?: ?string,
|
||||
|};
|
||||
|
||||
declare export type NavigationSetParamsAction = {|
|
||||
type: 'Navigation/SET_PARAMS',
|
||||
|
||||
@@ -100,26 +86,11 @@ declare module 'react-navigation' {
|
||||
params: NavigationParams,
|
||||
|};
|
||||
|
||||
declare type DeprecatedNavigationSetParamsAction = {|
|
||||
type: 'SetParams',
|
||||
|
||||
// The key of the route where the params should be set
|
||||
key: string,
|
||||
|
||||
// The new params to merge into the existing route params
|
||||
params: NavigationParams,
|
||||
|};
|
||||
|
||||
declare export type NavigationInitAction = {|
|
||||
type: 'Navigation/INIT',
|
||||
params?: NavigationParams,
|
||||
|};
|
||||
|
||||
declare type DeprecatedNavigationInitAction = {|
|
||||
type: 'Init',
|
||||
params?: NavigationParams,
|
||||
|};
|
||||
|
||||
declare export type NavigationResetAction = {|
|
||||
type: 'Navigation/RESET',
|
||||
index: number,
|
||||
@@ -127,25 +98,11 @@ declare module 'react-navigation' {
|
||||
actions: Array<NavigationNavigateAction>,
|
||||
|};
|
||||
|
||||
declare type DeprecatedNavigationResetAction = {|
|
||||
type: 'Reset',
|
||||
index: number,
|
||||
key?: ?string,
|
||||
actions: Array<
|
||||
NavigationNavigateAction | DeprecatedNavigationNavigateAction
|
||||
>,
|
||||
|};
|
||||
|
||||
declare export type NavigationUriAction = {|
|
||||
type: 'Navigation/URI',
|
||||
uri: string,
|
||||
|};
|
||||
|
||||
declare type DeprecatedNavigationUriAction = {|
|
||||
type: 'Uri',
|
||||
uri: string,
|
||||
|};
|
||||
|
||||
declare export type NavigationReplaceAction = {|
|
||||
+type: 'Navigation/REPLACE',
|
||||
+key: string,
|
||||
@@ -181,17 +138,6 @@ declare module 'react-navigation' {
|
||||
| NavigationSetParamsAction
|
||||
| NavigationResetAction;
|
||||
|
||||
declare type DeprecatedNavigationAction =
|
||||
| DeprecatedNavigationInitAction
|
||||
| DeprecatedNavigationNavigateAction
|
||||
| DeprecatedNavigationBackAction
|
||||
| DeprecatedNavigationSetParamsAction
|
||||
| DeprecatedNavigationResetAction;
|
||||
|
||||
declare export type PossiblyDeprecatedNavigationAction =
|
||||
| NavigationAction
|
||||
| DeprecatedNavigationAction;
|
||||
|
||||
/**
|
||||
* NavigationState is a tree of routes for a single navigator, where each
|
||||
* child route may either be a NavigationScreenRoute or a
|
||||
@@ -482,7 +428,7 @@ declare module 'react-navigation' {
|
||||
*/
|
||||
|
||||
declare export type NavigationDispatch = (
|
||||
action: PossiblyDeprecatedNavigationAction
|
||||
action: NavigationAction
|
||||
) => boolean;
|
||||
|
||||
declare export type NavigationProp<S> = {
|
||||
@@ -789,9 +735,6 @@ declare module 'react-navigation' {
|
||||
(payload: { uri: string }): NavigationUriAction,
|
||||
toString: () => string,
|
||||
},
|
||||
mapDeprecatedActionAndWarn: (
|
||||
action: PossiblyDeprecatedNavigationAction
|
||||
) => NavigationAction,
|
||||
};
|
||||
|
||||
declare type _RouterProp<S: NavigationState, O: {}> = {
|
||||
|
||||
Reference in New Issue
Block a user