import React from 'react'; import Expo from 'expo'; import { FlatList } from 'react-native'; import { createSwitchNavigator } from 'react-navigation'; import { createStackNavigator } from 'react-navigation-stack'; import { ListSection, Divider } from 'react-native-paper'; import SimpleStack from './src/SimpleStack'; import TransparentStack from './src/TransparentStack'; import ModalStack from './src/ModalStack'; import GestureInteraction from './src/GestureInteraction'; // Comment the following two lines to stop using react-native-screens import { useScreens } from 'react-native-screens'; // useScreens(); const data = [ { component: SimpleStack, title: 'Simple', routeName: 'SimpleStack' }, { component: ModalStack, title: 'Modal', routeName: 'ModalStack' }, { component: TransparentStack, title: 'Transparent', routeName: 'TransparentStack', }, { component: GestureInteraction, title: 'Gesture Interaction', routeName: 'GestureInteraction' }, ]; class Home extends React.Component { static navigationOptions = { title: 'Examples', }; _renderItem = ({ item }) => ( this.props.navigation.navigate(item.routeName)} /> ); _keyExtractor = item => item.routeName; render() { return ( ); } } const App = createSwitchNavigator({ Home: createStackNavigator({ Home }), ...data.reduce((acc, it) => { acc[it.routeName] = { screen: it.component, navigationOptions: { title: it.title, }, }; return acc; }, {}), }); Expo.registerRootComponent(App);