Invariant Violation: The navigation prop is missing for this navigator

后端 未结 10 2597
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-30 23:20

I am receiving this message when I tried starting my react native app. Usually this kind of format works on other multi screen navigation yet somehow does not work in this c

10条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-01 00:07

    I wasted my 2.5 hours to got this solution after many google searches...Hope this will work.

    just import this two:

    import { createStackNavigator } from "react-navigation-stack";
    import { createAppContainer } from "react-navigation";
    

    and make a little change to your code like this:

    create const above the class

    const AppNavigator = createAppContainer(RootStack);
    

    and finally call that const in the class instead of

    
    

    Thankx!

提交回复
热议问题