title: Error 'undefined is not an object (evaluating '_AppNavigator2.default.router') for React Navigation / Redux Implementation for React Native
body: <p>I'm trying to build a StackNavigator into my redux store using react-navigation, and I keep getting the error
  <a href="https://i.stack.imgur.com/4cgZU.png" rel="nofollow noreferrer">here</a> (and mentioned above in the title).</p>
  
  <p>Below is my code for my react-native project using redux.  The error is popping up on my reducer where I call <code>AppNavigator.router</code>.</p>
  
  <h1>src/AppNavigator.js</h1>
  
  <pre><code>import { StackNavigator, createStackNavigator } from 'react-navigation';
  import Welcome from './screens/Welcome';
  import Dashboard from './screens/Dashboard';
  import Login from './screens/Login';
  
  export const AppNavigator = StackNavigator(
    {
      Welcome: {
        screen: Welcome,
        navigationOptions: ({
          header: 'null',
          headerStyle: {
            backgroundColor: 'white',
            borderBottomWidth: 0,
          },
          headerTitleStyle: {
            fontSize: 30,
            fontFamily: 'Roboto-Bold',
          },
        }),
      },
      Dashboard: {
        screen: Dashboard,
        navigationOptions: ({
          title: 'Dashboard',
          headerStyle: {
            backgroundColor: 'white',
            borderBottomWidth: 0,
          },
          headerTitleStyle: {
            fontSize: 30,
            fontFamily: 'Roboto-Bold',
          },
          headerLeft: null,
        }),
      },
      Login: {
        screen: Login,
        navigationOptions: ({
          title: 'Login or Register',
          headerStyle: {
            backgroundColor: 'white',
            borderBottomWidth: 0,
          },
          headerTitleStyle: {
            fontSize: 30,
            fontFamily: 'Roboto-Bold',
          },
          headerLeft: null,
        }),
      },
    },
    {
      initialRouteName: 'Dashboard',
    },
  );
  </code></pre>
  
  <h1>src/AppWithInternalState.js</h1>
  
  <pre><code>import React from 'react';
  import { connect } from 'react-redux';
  import { addNavigationHelpers } from 'react-navigation';
  import AppNavigator from './AppNavigator';
  
  const AppWithInternalState = ({ dispatch, nav }) =&gt; (
    &lt;AppNavigator navigation={
      addNavigationHelpers({
        dispatch,
        state: nav,
      })
    }/&gt;
  );
  
  const mapStateToProps = state =&gt; ({
    nav: state.nav,
  });
  
  export default connect(mapStateToProps)(AppWithInternalState);
  </code></pre>
  
  <h1>/src/reducers/navReducer.js</h1>
  
  <pre><code>import React from 'react';
  import AppNavigator from '../AppNavigator';
  
  const router = AppNavigator.router;
  const mainNavAction = router.getActionforPathandParams('Welcome');
  const initialNavState = router.getStateForAction(mainNavAction);
  
  export default navReducer = (state = initialNavState, action) =&gt; (
    router.getStateForAction(action, state)
  );
  </code></pre>
  
  <p>Appreciate any help!</p>