react-native-material-bottom-navigation错误找不到变量选项卡

时间:2018-08-30 10:52:45

标签: react-native-android react-native-navigation

嗨,我在编写react-native时遇到错误,当我尝试使用react-native-material-bottom-navigation时,我在react-native中确实很新,我只是从教程中复制但我遇到了一些错误,我没有不知道我的代码会发生什么

这是我的代码

import React, { Component } from 'react';
import { View,Icon } from 'react-native';
import { Container, Header, Content, Footer, FooterTab, Button, Text } from 'native-base';
import BottomNavigation, { FullTab} from 'react-native-material-bottom-navigation'
export default class App extends React.Component {
 tabs = [
 {
  key: 'games',
  icon: 'gamepad-variant',
  label: 'Games',
  barColor: '#388E3C',
  pressColor: 'rgba(255, 255, 255, 0.16)'
},
{ 
  key: 'movies-tv',
  icon: 'movie',
  label: 'Movies & TV',
  barColor: '#B71C1C',
  pressColor: 'rgba(255, 255, 255, 0.16)'
},
{
  key: 'music',
  icon: 'music-note',
  label: 'Music',
  barColor: '#E64A19',
  pressColor: 'rgba(255, 255, 255, 0.16)'
}
]
renderIcon = icon => ({ isActive }) => (<Icon size={24} color="white" name={tab.icon} />)
renderTab = ({ tab, isActive }) => (<FullTab isActive={isActive} key= tab.key} label={tab.label} renderIcon={this.renderIcon(tab.icon)}/> )
render() {
return (
  <View style={{ flex: 1 }}>
    <View style={{ flex: 1 }}>
      {/* Your screen contents depending on current tab. */}
    </View>
    <BottomNavigation
      onTabPress={activeTab => this.setState({ activeTab })}
      renderTab={this.renderTab}
      tabs={this.tabs}
    />
  </View>
)}
}

this error i get

对不起,我英语不好

0 个答案:

没有答案