[react-navigation]: added types in navigate params

This commit is contained in:
ArmandoAssuncao
2018-03-02 23:07:22 -03:00
parent b57cb07c54
commit fa04697ee1
2 changed files with 4 additions and 3 deletions

View File

@@ -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;

View File

@@ -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.