2
votes

I am trying to connect my actions in one of my screens in a stack. After hours of fumbling around, I realize connect is not 'connecting' to my screen for some reason. Is there a reason why when using React Navigation some screens connect to Redux and some don't?

const AppSwitchNavigator = createSwitchNavigator({
  Open: { screen: AuthStackNavigator },
  Home: { screen: MainStackNavigator }
})

const AppContainer = createAppContainer(AppSwitchNavigator)

class App extends Component {
  render() {
    return <Provider store={store}><AppContainer /></Provider>
  }
}

I seem to have access to the store in the 'Home' stack, but not in the 'Open' stack. Is this possible? I am so confused...

UPDATE - I have figured out the solution. The issue was that within my stacknavigator I did not import all the screens, thus the Redux Store was not aware of them. So simply importing all the screens within the stack navigator fixed the problem.