mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-18 07:51:48 +08:00
[react-navigation]: added types in navigate params
This commit is contained in:
5
types/react-navigation/index.d.ts
vendored
5
types/react-navigation/index.d.ts
vendored
@@ -14,6 +14,7 @@
|
||||
// Veit Lehmann: <https://github.com/levito>
|
||||
// Roberto Huertas: <https://github.com/robertohuertasm>
|
||||
// Steven Miller <https://github.com/YourGamesBeOver>
|
||||
// Armando Assuncao <https://github.com/ArmandoAssuncao>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
@@ -396,13 +397,13 @@ export interface NavigationEventSubscription {
|
||||
remove: () => void;
|
||||
}
|
||||
|
||||
export interface NavigationScreenProp<S> {
|
||||
export interface NavigationScreenProp<S, P = NavigationParams> {
|
||||
state: S;
|
||||
dispatch: NavigationDispatch;
|
||||
goBack: (routeKey?: (string | null)) => boolean;
|
||||
navigate: (
|
||||
routeName: string,
|
||||
params?: NavigationParams,
|
||||
params?: P,
|
||||
action?: NavigationAction
|
||||
) => boolean;
|
||||
setParams: (newParams: NavigationParams) => boolean;
|
||||
|
||||
@@ -250,7 +250,7 @@ function renderBasicDrawerNavigator(): JSX.Element {
|
||||
}
|
||||
|
||||
interface CustomTransitionerProps {
|
||||
navigation: NavigationScreenProp<any>;
|
||||
navigation: NavigationScreenProp<any, any>;
|
||||
}
|
||||
/**
|
||||
* @desc Custom transitioner component. Follows react-navigation/src/views/CardStackTransitioner.js.
|
||||
|
||||
Reference in New Issue
Block a user