Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/fortran/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
React native 如何在另一个React组件中使用CreateBoottomTabNavigator_React Native_React Navigation - Fatal编程技术网

React native 如何在另一个React组件中使用CreateBoottomTabNavigator

React native 如何在另一个React组件中使用CreateBoottomTabNavigator,react-native,react-navigation,React Native,React Navigation,我正在将旧的react原生项目更新为一个新项目,并且 不变冲突:此导航器缺少导航道具… 现在出错。但是我不知道如何在最新的react导航版本的另一个组件中使用CreateBoottomTabNavigator 感谢您的帮助 renderModel(){ 返回( 模拟样品 //这是CreateBoottomTabNavigator。 ) }下面是我在React组件中实现CreateBoottomTabNavigator的示例 注意:我使用的是react导航版本3.3.0 import { cre

我正在将旧的react原生项目更新为一个新项目,并且

不变冲突:此导航器缺少导航道具…

现在出错。但是我不知道如何在最新的react导航版本的另一个组件中使用
CreateBoottomTabNavigator

感谢您的帮助

renderModel(){
返回(
模拟样品
//这是CreateBoottomTabNavigator。
)

}
下面是我在React组件中实现CreateBoottomTabNavigator的示例

注意:我使用的是react导航版本3.3.0

import { createBottomTabNavigator, createAppContainer } from 'react-navigation'
import FirstTab from './tabs/FirstTab';
import SecondTab from './tabs/SecondTab';
import ThirdTab from './tabs/ThirdTab';
import FourthTab from './tabs/FourthTab';
import FifthTab from './tabs/FifthTab'
const BottomTabNav = createBottomTabNavigator(
  {
    FirstTab,
    SecondTab,
    ThirdTab,
    FourthTab,
    FifthTab
  },
  {
    initialRouteName: 'FirstTab',
  }
);

export default createAppContainer(BottomTabNav);
渲染时:

      render() {
    return (
      <View style={{flex:1, backgroundColor: 'white'}}>

        <Text style={{paddingTop:20}}>Text on the Top of BottomTab Navigator</Text>

        <BottomTabNav/> 

      </View>

    )
  }
}
render(){
返回(
底部选项卡导航器顶部的文本
)
}
}
输出图像: