diff --git a/example/App.js b/example/App.js index 45bbf06..e53bbba 100644 --- a/example/App.js +++ b/example/App.js @@ -1,7 +1,7 @@ import React from 'react'; import Expo from 'expo'; import { FlatList, I18nManager } from 'react-native'; -import { createSwitchNavigator } from 'react-navigation'; +import { createAppContainer } from '@react-navigation/native'; import { Assets as StackAssets, createStackNavigator, @@ -74,18 +74,28 @@ class Home extends React.Component { } } -const App = createSwitchNavigator({ - Home: createStackNavigator({ Home }), - ...data.reduce((acc, it) => { - acc[it.routeName] = { - screen: it.component, - navigationOptions: { - title: it.title, - }, - }; +const Root = createStackNavigator( + { + Home: createStackNavigator({ Home }), + ...data.reduce((acc, it) => { + acc[it.routeName] = { + screen: it.component, + navigationOptions: { + title: it.title, + }, + }; - return acc; - }, {}), -}); + return acc; + }, {}), + }, + { + mode: 'modal', + headerMode: 'none', + defaultNavigationOptions: { + gesturesEnabled: false, + }, + } +); +const App = createAppContainer(Root); Expo.registerRootComponent(App); diff --git a/example/package.json b/example/package.json index 35caa3f..e7bb1e2 100644 --- a/example/package.json +++ b/example/package.json @@ -9,8 +9,8 @@ "postinstall": "rm -rf node_modules/expo-react-native-adapter/node_modules/react && rm -rf node_modules/expo-gl/node_modules/react" }, "dependencies": { - "@react-navigation/core": "^3.0.0-alpha.4", - "@react-navigation/native": "^3.0.0-alpha.5", + "@react-navigation/core": "^3.0.0-alpha", + "@react-navigation/native": "^3.0.0-alpha", "expo": "~30.0.0", "hoist-non-react-statics": "^2.5.0", "prop-types": "^15.6.0", diff --git a/example/rn-cli.config.js b/example/rn-cli.config.js index faa16fe..a5e1756 100644 --- a/example/rn-cli.config.js +++ b/example/rn-cli.config.js @@ -6,7 +6,7 @@ const blacklist = require('metro/src/blacklist'); const pak = require('../package.json'); const pak2 = require('./package.json'); -const dependencies = Object.keys(pak.dependencies); +const dependencies = Object.keys(pak.dependencies || {}); const localDependencies = Object.keys(pak2.dependencies); const peerDependencies = Object.keys(pak.peerDependencies); diff --git a/example/src/SimpleStack.js b/example/src/SimpleStack.js index a73c995..68e0da5 100644 --- a/example/src/SimpleStack.js +++ b/example/src/SimpleStack.js @@ -1,7 +1,26 @@ import React from 'react'; import { Button, View, Text } from 'react-native'; +import { withNavigation } from '@react-navigation/core'; import { createStackNavigator } from 'react-navigation-stack'; +const Buttons = withNavigation((props) => ( + +