由于TypeError无法实现TabBarIOS

时间:2019-03-22 20:17:15

标签: javascript reactjs react-native

我不能推动TabBarIOS。下面的代码呈现“未处理的JS异常:TypeError:无法读取未定义的属性'Item'”

我的依赖关系很小
“ react”:“ 16.8.3”, “ react-native”:“ 0.59.1”

import React, { Component } from 'react'; 
import { 
  TabBarIOS,
  View, 
  Text 
} from 'react-native'; 


export default class HomeScreen extends Component { 
  constructor(props) { 
    super(props); 
    this.state = { 
      tab: 'newsFeed' 
    }; 
  } 
  render() {  

    return ( 
      <TabBarIOS>
        <TabBarIOS.Item
          systemIcon={'featured'} 
          selected={this.state.tab === 'newsFeed'} 
          onPress={() => this.setState({ tab: 'newsFeed' })}
        >
          <Text>Hello</Text>
        </TabBarIOS.Item> 
      </TabBarIOS>
    ); 
  } 
} 

1 个答案:

答案 0 :(得分:3)

TabBarIOS已根据this unofficial changelog从v0.59中的React Native中删除。