undefined不是对象(评估'_reactNative.PropTypes.string')错误

Chi*_*ire 5 android reactjs react-native

当我实现第三方库时出现此错误,如https://github.com/ayoubdev/react-native-android-kit这个错误表示什么?

 'use strict';

import React, {Component} from 'react';
import{
 Platform,
 StyleSheet,
 Text,
 View,
 Image,
 Navigator,
 ToolbarAndroid,
 ScrollView
}from 'react-native';

import EventList from './javra-event-list';
  import AndroidToolBar from './javra-android-toolbar';
 import JResource from '../../javra-resource';
 import ScrollableTabView, {DefaultTabBar,ScrollableTabBar} from 'react-native-scrollable-tab-view';
  import CustomTab1 from './javra-custom-tabbar';


 import {TabLayoutAndroid, TabAndroid} from "react-native-android-kit";

 export default class Home extends Component{

  constructor(props){
  super(props);
  this.eventThumnailHandler = this.eventThumnailHandler.bind(this);
  this.movies = [{id:1,title:'Event 2016'},{id:2,title:'Event 2015'},{id:3,title:'Event 2014'},{id:4,title:'Event 2013'},
                {id:5,title:'Event 2016'},{id:6,title:'Event 2015'},{id:7,title:'Event 2014'},{id:8,title:'Event 2013'}
              ];

 }

 static childContextTypes = {
   eventThumnailHandler: React.PropTypes.func.isRequired,

 };

 getChildContext() {
   return {
     eventThumnailHandler: (item) => (this.eventThumnailHandler(item)),

   };
   }

 static contextTypes = {
    openDrawer: React.PropTypes.func.isRequired,
  };

  _openDrawer(){
    this.context.openDrawer();
  }


  eventThumnailHandler(item: Object){
    console.log('*/*/*/*///*/*/: ' + item.title);
    this.props.navigator.push(
      {id: 'NewView' , index:1}
    )
  }

render(){
 var toolbarActions = [{title:'Next',show:'always'}];
 return(
  <View style={{flex:1}}>

                <TabLayoutAndroid style={{height:60}} backgroundColor='#009688' indicatorTabColor='#ffc400'
                                  indicatorTabHeight={2} scrollable={false} center={false}>

                    <TabAndroid text='Tab1' textSize={16} textColor="white" selectedTextColor='#ffc400'
                                icon='ic_home_black_24dp' iconPosition='left'>

                        <Text>I'm the first Tab content!</Text>

                    </TabAndroid>

                    <TabAndroid text='Tab2' textSize={16} textColor='white' selectedTextColor='#ffc400'
                                icon='ic_important_devices_black_24dp' iconPosition='left'>

                        <Text>I'm the second Tab content!</Text>

                    </TabAndroid>

                </TabLayoutAndroid>

            </View>
);
}
}
Run Code Online (Sandbox Code Playgroud)

我已经实现了上面提到的链接提供的tablayout.什么可能是我的文件中的错误.请指教我.

小智 5

import React, { Component, PropTypes } from 'react';
import {
  StyleSheet,
  Text,
  TouchableOpacity,
  View
} from 'react-native';
Run Code Online (Sandbox Code Playgroud)

在组件旁边包含PropTypes帮助了我

  • 为了详细说明这一点,较新版本的 React Native 从 `react-native` 中删除了 `PropTypes 和 `Component`,现在是基础 React 包的一部分:**Before**: import React, { Component, PropTypes, View,来自'react-native'的文本};**现在**:从“react”导入 React, { Component, PropTypes }; 从'react-native'导入{视图,文本}; (2认同)