<legend id='L7bTz'><style id='L7bTz'><dir id='L7bTz'><q id='L7bTz'></q></dir></style></legend>
    <i id='L7bTz'><tr id='L7bTz'><dt id='L7bTz'><q id='L7bTz'><span id='L7bTz'><b id='L7bTz'><form id='L7bTz'><ins id='L7bTz'></ins><ul id='L7bTz'></ul><sub id='L7bTz'></sub></form><legend id='L7bTz'></legend><bdo id='L7bTz'><pre id='L7bTz'><center id='L7bTz'></center></pre></bdo></b><th id='L7bTz'></th></span></q></dt></tr></i><div id='L7bTz'><tfoot id='L7bTz'></tfoot><dl id='L7bTz'><fieldset id='L7bTz'></fieldset></dl></div>

    <small id='L7bTz'></small><noframes id='L7bTz'>

        <bdo id='L7bTz'></bdo><ul id='L7bTz'></ul>
      <tfoot id='L7bTz'></tfoot>
    1. 在屏幕之间发送状态反应原生

      时间:2023-11-29

          <small id='MGXP2'></small><noframes id='MGXP2'>

          1. <legend id='MGXP2'><style id='MGXP2'><dir id='MGXP2'><q id='MGXP2'></q></dir></style></legend><tfoot id='MGXP2'></tfoot>
            <i id='MGXP2'><tr id='MGXP2'><dt id='MGXP2'><q id='MGXP2'><span id='MGXP2'><b id='MGXP2'><form id='MGXP2'><ins id='MGXP2'></ins><ul id='MGXP2'></ul><sub id='MGXP2'></sub></form><legend id='MGXP2'></legend><bdo id='MGXP2'><pre id='MGXP2'><center id='MGXP2'></center></pre></bdo></b><th id='MGXP2'></th></span></q></dt></tr></i><div id='MGXP2'><tfoot id='MGXP2'></tfoot><dl id='MGXP2'><fieldset id='MGXP2'></fieldset></dl></div>

            • <bdo id='MGXP2'></bdo><ul id='MGXP2'></ul>
                <tbody id='MGXP2'></tbody>

              1. 本文介绍了在屏幕之间发送状态反应原生的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我目前正在使用一个应用程序,该应用程序将为您提供来自幻想 api 的类/种族/背景故事.我在创建项目时使用了 expo 的标签模板.

                Am currently working with an app that will provide you with a class/race/background story from an fantasy api. I used expo's tab template when i created the project.

                所以我的问题是如何将我在比赛屏幕中获取的数据发送到我的背景故事屏幕以获取正确的背景故事?我一直在尝试用谷歌搜索它,但找不到有帮助的答案,我唯一发现的是它与导航器有关,因此我链接它.

                So my question is how would I send data that i fetched in my Race screen to my background-story screen in order to fetch the correct background-story? I've been trying to googling it but couldnt find an answer that helped, the only thing i found is that its something to do with the navigator, hence why i link it.

                Maintabnavigator.js

                Maintabnavigator.js

                    import React from 'react';
                import { Platform } from 'react-native';
                import { createStackNavigator, createBottomTabNavigator, createDrawerNavigator } from 'react-navigation';
                import { Icon } from 'expo';
                import { Ionicons} from '@expo/vector-icons';
                import HomeScreen from '../screens/HomeScreen';
                import CharacterScreen from '../screens/CharacterScreen';
                import BackgroundDetails from '../screens/CharacterScreens/BackgroundDetails';
                import RaceDetails from '../screens/CharacterScreens/RaceDetails';
                import ClassDetails from '../screens/CharacterScreens/ClassDetails';
                
                
                const RaceStack = createStackNavigator({
                  race: RaceDetails
                });
                const ClassStack = createStackNavigator({
                  class: ClassDetails
                });
                const BackgroundStack = createStackNavigator({
                  background: BackgroundDetails
                });
                const GeneratorStack = createStackNavigator({
                  generator: CharacterScreen,
                });
                
                
                GeneratorStack.navigationOptions= {
                  tabBarLabel: 'Generator',
                  tabBarIcon: ({focused}) => (
                    <Icon.Entypo
                      focused={focused}
                      name={'retweet'}
                      size={26}
                    />
                  )
                }
                RaceStack.navigationOptions= {
                  tabBarLabel: 'Race',
                  tabBarIcon: ({focused}) => (
                    <Icon.MaterialIcons
                      focused={focused}
                      name={'person'}
                      size={26}
                    />
                  )
                }
                ClassStack.navigationOptions= {
                  tabBarLabel: 'Class',
                  tabBarIcon: ({focused}) => (
                    <Icon.MaterialCommunityIcons
                      focused={focused}
                      name={'sword-cross'}
                      size={26}
                    />
                  )
                }
                BackgroundStack.navigationOptions= {
                  tabBarLabel: 'Background Story',
                  tabBarIcon: ({focused}) => (
                    <Icon.Feather
                      focused={focused}
                      name={'book'}
                      size={26}
                    />
                  )
                }
                export default createBottomTabNavigator({
                  GeneratorStack,
                  ClassStack,
                  RaceStack,
                  BackgroundStack,
                });
                

                推荐答案

                当您从一个屏幕导航到另一个屏幕时,如下所示:

                When you navigate from one screen to another as follows:

                this.props.navigation.navigate('ContactDisplay', { item });
                

                您可以在另一个屏幕中访问项目",如下所示:

                You may access 'item' in the other screen as follows:

                console.log(this.props.navigation.state.params.item);
                

                这篇关于在屏幕之间发送状态反应原生的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:使用 react-native 应用程序连接到 MongoDB Atlas Cluster db 下一篇:Undefined is not an object (evalating 'React.PropTypes.N

                相关文章

                1. <i id='LhKzp'><tr id='LhKzp'><dt id='LhKzp'><q id='LhKzp'><span id='LhKzp'><b id='LhKzp'><form id='LhKzp'><ins id='LhKzp'></ins><ul id='LhKzp'></ul><sub id='LhKzp'></sub></form><legend id='LhKzp'></legend><bdo id='LhKzp'><pre id='LhKzp'><center id='LhKzp'></center></pre></bdo></b><th id='LhKzp'></th></span></q></dt></tr></i><div id='LhKzp'><tfoot id='LhKzp'></tfoot><dl id='LhKzp'><fieldset id='LhKzp'></fieldset></dl></div>

                  <small id='LhKzp'></small><noframes id='LhKzp'>

                      <bdo id='LhKzp'></bdo><ul id='LhKzp'></ul>
                    <legend id='LhKzp'><style id='LhKzp'><dir id='LhKzp'><q id='LhKzp'></q></dir></style></legend>
                  1. <tfoot id='LhKzp'></tfoot>