1
1
import React , { Component } from 'react'
2
- import { createStackNavigator , createAppContainer } from 'react-navigation'
3
2
import NavigationService from 'App/Services/NavigationService'
3
+ import AppNavigator from 'App/Navigators/AppNavigator'
4
4
import { View } from 'react-native'
5
5
import styles from './RootScreenStyle'
6
- import ExampleScreen from 'App/Containers/Example/ExampleScreen'
7
- import SplashScreen from 'App/Containers/SplashScreen/SplashScreen'
8
6
import { connect } from 'react-redux'
9
7
import StartupActions from 'App/Stores/Startup/Actions'
10
8
import { PropTypes } from 'prop-types'
11
9
12
- /**
13
- * The root screen contains the application's navigation.
14
- *
15
- * @see https://reactnavigation.org/docs/en/hello-react-navigation.html#creating-a-stack-navigator
16
- */
17
- const AppNav = createStackNavigator (
18
- {
19
- // Create the application routes here (the key is the route name, the value is the target screen)
20
- // See https://reactnavigation.org/docs/en/stack-navigator.html#routeconfigs
21
- SplashScreen : SplashScreen ,
22
- // The main application screen is our "ExampleScreen". Feel free to replace it with your
23
- // own screen and remove the example.
24
- MainScreen : ExampleScreen ,
25
- } ,
26
- {
27
- // By default the application will show the splash screen
28
- initialRouteName : 'SplashScreen' ,
29
- // See https://reactnavigation.org/docs/en/stack-navigator.html#stacknavigatorconfig
30
- headerMode : 'none' ,
31
- }
32
- )
33
-
34
- const App = createAppContainer ( AppNav )
35
-
36
10
class RootScreen extends Component {
37
11
componentDidMount ( ) {
38
12
// Run the startup saga when the application is starting
@@ -42,7 +16,7 @@ class RootScreen extends Component {
42
16
render ( ) {
43
17
return (
44
18
< View style = { styles . container } >
45
- < App
19
+ < AppNavigator
46
20
// Initialize the NavigationService (see https://reactnavigation.org/docs/en/navigating-without-navigation-prop.html)
47
21
ref = { ( navigatorRef ) => {
48
22
NavigationService . setTopLevelNavigator ( navigatorRef )
0 commit comments