嗨,我在编写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>
)}
}
对不起,我英语不好