react-navigation:无法读取未定义的属性“ prototype”

时间:2019-11-12 03:24:02

标签: react-native react-navigation react-navigation-stack

我收到以下错误“无法读取未定义的属性'prototype'”,我已链接,pod install -ed,但无法克服以上错误。在响应导航文档之后,我删除了很多错误。我在哪里出错?

我的设置:
package.json:

"dependencies": {
  "axios": "^0.19.0",
  "eslint": "^4.0.0",
  "react": "16.4.1",
  "react-native": "0.56.1",
  "react-native-force": "https://github.com/forcedotcom/SalesforceMobileSDK-ReactNative.git#v7.0.0",
  "react-native-gesture-handler": "^1.5.0",
  "react-native-keyboard-aware-scroll-view": "^0.9.1",
  "react-native-reanimated": "^1.4.0",
  "react-native-screens": "^2.0.0-alpha.8",
  "react-navigation": "^4.0.10",
  "react-navigation-stack": "^1.10.3",
  "react-navigation-tabs": "^2.5.6",
  "react-redux": "^7.1.3",
  "redux": "^4.0.4",
  "whatwg-fetch": "1.1.1"
},
"devDependencies": {
  "babel-preset-react-native": "5.0.2",
  "jetifier": "^1.6.4",
  "rimraf": "2.6.2"
}

这是我的 app.js

import React, { Component } from 'react';
import { createAppContainer } from 'react-navigation';
import { createStackNavigator } from 'react-navigation-stack';
import { createBottomTabNavigator } from 'react-navigation-tabs';
import ProductList from "./src/components/ProductList/ProductList";
import ProductReview from "./src/components/ProductReview/ProductReview";
import AddReview from "./src/components/AddReview/AddReview";
import { Provider } from 'react-redux';
import store from 'store';

const AppNavigator = createStackNavigator({
  Home: { screen: ProductList },
  Review: { screen: ProductReview }
}, {
  defaultNavigationOptions: {
    headerStyle: {
      backgroundColor: '#0d39ff',
      color: '#FFF'
    },
    headerTintColor: '#FFF',
    headerTitleStyle: {
      color: '#FFF'
    },
    tintColor: 'blue'
  }
});


const Tabs = createBottomTabNavigator({
  Product: { screen: AppNavigator }
},
  {
    defaultNavigationOptions: ({ navigation }) => {
      return {
        tabBarIcon: ({ tintColor }) => {
          const route = navigation.state.routeName;
          const name = {
            'Product': 'list'
          }[route]
          return <Icon name={name} color={tintColor} size={22} />
        },
        tabBarOptions: {
          activeBackgroundColor: '#E6F0FA'
        }
      }
    }
  });

const appNavigation = createStackNavigator({
  Tabs: { screen: Tabs },
  AddReview: { screen: AddReview }
}, {
  mode: 'modal',
  headerMode: 'none',
  navigationOptions: {
    gesturesEnabled: false
  }
});

const Navigation = createAppContainer(appNavigation);
type Props = {};
export default class App extends Component<Props> {
  render() {
    return (
      <Provider store={store}>
        <Navigation />
      </Provider>
    );
  }
}

错误:

  方法-[RCTAppState getCurrentAppState:error:]中的

未知参数类型'属性'。扩展RCTConvert以支持该类型。

     

警告:React.createElement:类型无效-预期为字符串(对于内置组件)或类/函数(对于复合组件),但得到:未定义。您可能忘记了从定义文件中导出组件,或者可能混淆了默认导入和命名导入。

     

在renderApplication.js:32上检查代码。

     

在使用参数调用目标AppState上的getCurrentAppState时引发了异常'***-[__ NSArrayM objectAtIndexedSubscript:]:索引1超出范围[0 .. 0]'       2,       3   )

0 个答案:

没有答案