React Native error: Element type is invalid: expected a string or a class/function but got: object

后端 未结 9 765
不知归路
不知归路 2020-12-28 13:39

I am getting this error and I am having a lot of trouble fixing this.

What I am trying to do here is have 3 different screens and have a tabbar that navigates to eac

9条回答
  •  伪装坚强ぢ
    2020-12-28 13:51

    In my vase I was on react-native 0.46.4 and had something like import MainContainer from './app' where the app directory had a shared index.js file amongst Android and iOS, but React Native wasn't detecting an index.js inside app. Once I switched to import MainContainer from './app/index.js' it worked.

提交回复
热议问题