diff --git a/types/react-navigation/react-navigation-tests.tsx b/types/react-navigation/react-navigation-tests.tsx index 535a7a04af..3a4e02a16c 100644 --- a/types/react-navigation/react-navigation-tests.tsx +++ b/types/react-navigation/react-navigation-tests.tsx @@ -1,5 +1,8 @@ import * as React from 'react'; -import { View } from 'react-native'; +import { + TouchableOpacity, + View, +} from 'react-native'; import { addNavigationHelpers, NavigationScreenProps, @@ -28,6 +31,40 @@ class StartScreen extends React.Component { const id = this.props.navigation.state.params.id; const s = this.props.navigation.state.params.s; + return ( + + + + ); + } + private navigateToNextScreen = (): void => { + this.props.navigation.navigate( + ROUTE_NAME_NEXT_SCREEN, + { + id: this.props.navigation.state.params.id, + name: this.props.navigation.state.params.s, + } as NextScreenComponentProps, + ); + + } +} + +/** + * @class NextScreen @extends React.Component + */ +const ROUTE_NAME_NEXT_SCREEN = "NextScreen"; +interface NextScreenComponentProps { + id: number, + name: string, +} +interface NextScreenProps extends NavigationScreenProps { } +class NextScreen extends React.Component { + render() { + // Implicit type checks. + const navigationStateParams: NextScreenComponentProps = this.props.navigation.state.params; + const id = this.props.navigation.state.params.id; + const name = this.props.navigation.state.params.name; + return ( );