createStackNavigation invariant violation element type is invalid expected a string

后端 未结 2 973
谎友^
谎友^ 2021-01-27 21:13

Upon creating importing and using createStackNavigation I\'m getting the following error. Any help would be greatly appreciated! Also, this is my first app in react-native so pl

2条回答
  •  粉色の甜心
    2021-01-27 21:43

    On the DLLoading_2 page

    const AppContainer = createAppContainer(MainNavigation);
    
    • It's okay if you don't have the above code.
     constructor(props) {
        super(props);
    
        this.state = {};
      }
      .
      .
      .
    this.props.navigation.navigate('DlMain')
    
    
     
            
    • Is this necessary?

      MainNavigator.js

    const AppContainer = createAppContainer(MainNavigator);
    
    export default AppContainer;
    

提交回复
热议问题