我需要创建一个createBottomTabNavigator,但要具有屏幕动态。我试图在一个类中创建该类,因为我需要将数据发送到createBottomTabNavigator来过滤可能的选项卡,但这不起作用。您是否知道这个问题,谢谢您的帮助。
import React, { Component } from 'react'
import { Text, View } from 'react-native'
import { createBottomTabNavigator, createAppContainer } from 'react-navigation'
import HomeMain from '../Home/HomeMain';
import { createIconSetFromIcoMoon } from 'react-native-vector-icons';
import iconmoonSelection from '../../assets/fonts/selection.json';
const IconM = createIconSetFromIcoMoon(iconmoonSelection);
let BottomTabar = createBottomTabNavigator({
Home: {
screen: HomeMain
}
})
const AppCenter = createAppContainer(BottomTabar)
class TabBarMain extends Component {
constructor(props) {
super(props);
this.setState({
})
console.log('Props TabBarMain:', this.props);
}
render() {
return (
<View>
<BottomTabar />
</View>
)
}
}
//export default createAppContainer(TabBarMain);
export default TabBarMain;
我可以在tabBar中创建许多标签