我有这个导航树:
var NiceTab1 = createMaterialTopTabNavigator(
{
Tab_1: StackNav,
Tab_2: StackNav,
Tab_3: StackNav,
Tab_4: StackNav,
Tab_5: StackNav,
Tab_6: StackNav,
Tab_7: StackNav,
}
}
StackNav:
var StackNav= createStackNavigator({
FirstScreen: {
screen: ()=><MyScreen/>,
navigationOptions: {
headerShown: false
}
}
}
我的屏幕:
class MyScreen extends Component {
constructor(props) {
super(props);
this.state = {};
}
render() {
return (
<View style={styles.root}>
<StatusBar barStyle="light-content" />
<Text style={styles.title}>{HERE I NEED TO SHOW THE TOP BAR NAVIGATOR ROUTE NAME (navigation.state.routeName)}</Text>
</View>
)
}
}
如果我之间有StackNavigator,如何将顶部栏导航传递到屏幕组件?
谢谢大家