Skip to content

Instantly share code, notes, and snippets.

@artyorsh
Last active October 24, 2019 15:03
Show Gist options
  • Save artyorsh/092628f159eb75a3d8ee1b36050baad0 to your computer and use it in GitHub Desktop.
Save artyorsh/092628f159eb75a3d8ee1b36050baad0 to your computer and use it in GitHub Desktop.
Type definitions for Auth screens (Binding React Navigation 5 to Eva Design System)
import { ParamListBase, RouteProp } from '@react-navigation/core';
import { StackNavigationProp } from '@react-navigation/stack';
import { AppRoute } from './app-routes';
interface AuthNavigatorParams extends ParamListBase {
[AppRoute.SIGN_IN]: undefined;
[AppRoute.SIGN_UP]: undefined;
[AppRoute.RESET_PASSWORD]: undefined;
}
export interface SignInScreenProps {
navigation: StackNavigationProp<AuthNavigatorParams, AppRoute.SIGN_IN>;
route: RouteProp<AuthNavigatorParams, AppRoute.SIGN_IN>;
}
export interface SignUpScreenProps {
navigation: StackNavigationProp<AuthNavigatorParams, AppRoute.SIGN_UP>;
route: RouteProp<AuthNavigatorParams, AppRoute.SIGN_UP>;
}
export interface ResetPasswordScreenProps {
navigation: StackNavigationProp<AuthNavigatorParams, AppRoute.RESET_PASSWORD>;
route: RouteProp<AuthNavigatorParams, AppRoute.RESET_PASSWORD>;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment