Я пытаюсь использовать pass state от вложенного stackNavigator к tabNavigator .

Прежде всего, App.js navigation structure My App.js navigation structure выглядит следующим образом

App.js

 //tabNavigator. This is where I want to pass my state. const tabNavigator = createMaterialTopTabNavigator({ tabOne:tabOne, tabTwo: tabTwo, tabThree:tabThree }) //I nested tabNavigator to this StackNavigator const StackNavigator = createStackNavigator({ stackAndTab: { screen: tabNavigator, navigationOptions: ({ navigation }) ={amp}gt; ({ header: {amp}lt;CustomHeader navigation={navigation} /{amp}gt; , }) }, }, { defaultNavigationOptions: { header: null } }) //I have another stackNavigator where I put all my stackNavigators. const AllStackNavigator = createStackNavigator( { InitialScreen:InitialScreen, StackNavigator:StackNavigator, }, { defaultNavigationOptions: { header: null, }, }, ); //Finally I nest my StackNavigator to SwitchNavigator const SwitchNavigator = createSwitchNavigator( { AllStackNavigator:AllStackNavigator }, { defaultNavigationOptions: { header: null, }, }, ); const CombinedNavigator = createAppContainer(StartSwitchNavigator); export default class App extends React.Component { render() { return {amp}lt;CombinedNavigator/{amp}gt;; } } 

Я пытаюсь pass state в StackNavigator с StackNavigator следующим образом:

 export default class InitialScreen extends React.Component { constructor(props) { super(props) this.state = { newState:'this is new State' } } render() { return ( {amp}lt;View style={styles.container}{amp}gt; {amp}lt;TouchableOpacity onPress={()={amp}gt; this.props.navigation.navigate('StackNavigator', {state:'this.state.newState})} style={{width:'100%', height:110}}{amp}gt; {amp}lt;Text{amp}gt;pass state{amp}lt;/Text{amp}gt; {amp}lt;/TouchableOpacity{amp}gt; {amp}lt;/View{amp}gt; ); } } 

Мой вопрос

Как получить доступ к переданному состоянию newState (состояние, которое я передал из initialScreen ) в tabNavigator где tabOne , tabTwo , tabThree .