不断违反:尝试在ios模拟器中运行应用时遇到元素类型无效

时间:2018-10-07 09:33:26

标签: javascript reactjs react-native redux

每当我尝试在ios模拟器上运行我的应用程序时,都会抛出以下错误

enter image description here

它一直告诉我检查“ _class2”的渲染方法,我绝对不知道它的位置。

下面是我的导出和导入文件

index.js

import { AppRegistry } from 'react-native';
import App from './App';
import {Provider} from "react-redux"
import configureStore from "./src/Store/configureStore"
import React from "react"

const store= configureStore()

const Root = () => (
    <Provider store={store} >
        <App/>
    </Provider>
);



AppRegistry.registerComponent('Fluffy', () => Root);

App.js

import {Provider} from "react-redux"
import {Navigation} from "react-native-navigation"

import OnboardingScreen from "./src/screens/OnboardingScreen"
import HomeScreen from "./src/screens/HomeScreen"
import NewsScreen from "./src/screens/NewsScreen"
import ProfileScreen from "./src/screens/ProfileScreen"
import CartScreen from "./src/screens/CartScreen"
import ProfileInfoScreen from "./src/screens/ProfileInfoScreen"
import OrderScreen from "./src/screens/OrderScreen"
import configureStore from "./src/Store/configureStore"

const store = configureStore()

Navigation.registerComponent("fluffy.OnboardingScreen", ()=> OnboardingScreen,Provider,store)
Navigation.registerComponent("fluffy.HomeScreen",
 ()=>HomeScreen,
 store,
 Provider
 )
Navigation.registerComponent("fluffy.NewsScreen", ()=> NewsScreen,
store,
Provider)

Navigation.registerComponent("fluffy.ProfileScreen",
 ()=> ProfileScreen,
 Provider,
 store)

Navigation.registerComponent("fluffy.CartScreen",
 ()=> CartScreen,
 Provider,
 store)

Navigation.registerComponent("fluffy.ProfileInfoScreen", 
()=>ProfileInfoScreen,
Provider,
store)

Navigation.registerComponent("fluffy.OrderScreen", 
()=> OrderScreen,
Provider,
store)

export default () => Navigation.startSingleScreenApp({
screen : {
  screen: "fluffy.OnboardingScreen",
}
})

在此先感谢您的协助!

0 个答案:

没有答案