React Native BottomTabs navigating to a specific tabReact Native - Reset child stackNavigator to initial screen onPress of parent tabNavigatorReact Navigation with Redux - StackNavigator Load Other Screen Content in BackgroundReact native clear Stack Navigator stackcommon/shared screen routing in react navigation?React-Navigation - How to track state change in nested navigator onlyIn React Native how to navigate between screens?State Management in React Native AppHow to navigate from a screen in stack navigator to the Tab NavigatorReset createBottomTabNavigator to initial tab on navigation

Minimize taxes now that I earn more

How do I improve in sight reading?

Is the Necromancer's "Half-Formed Golem" pet available for all classes?

How would a native speaker correct themselves when they misspeak?

Cheap antenna for new HF HAM

Algorithm that spans orthogonal vectors: Python

Did Apollo carry and use WD40?

Nanomachines exist that enable Axolotl-levels of regeneration - So how can crippling injuries exist as well?

Do things made of adamantine rust?

Сardinality estimation of partially covering range predicates

Manager manipulates my leaves, what's in it for him?

Is there any reason nowadays to use a neon indicator lamp instead of an LED?

What can a pilot do if an air traffic controller is incapacitated?

GitHub repo with Apache License version 2 in package.json, but no full license copy nor comment headers

Is there any actual security benefit to restricting foreign IPs?

Can multiple wall timers turn lights on or off when required?

What is a Heptagon Number™?

pandas aggregate with dynamic column names

Simulate a 1D Game-of-Life-ish Model

Writing a letter of recommendation for a mediocre student

Is it really necessary to have 4 hours meeting in Sprint planning?

Why there so many pitch control surfaces on the Piaggio P180 Avanti?

How could artificial intelligence harm us?

Norwegian refuses EU delay (4.7 hours) compensation because it turned out there was nothing wrong with the aircraft



React Native BottomTabs navigating to a specific tab


React Native - Reset child stackNavigator to initial screen onPress of parent tabNavigatorReact Navigation with Redux - StackNavigator Load Other Screen Content in BackgroundReact native clear Stack Navigator stackcommon/shared screen routing in react navigation?React-Navigation - How to track state change in nested navigator onlyIn React Native how to navigate between screens?State Management in React Native AppHow to navigate from a screen in stack navigator to the Tab NavigatorReset createBottomTabNavigator to initial tab on navigation






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








2















I am trying to navigate to a specific tab from a screen, as the below code shows, I want to navigate to Tab2 from Screen1



Bottom Tabs



const BottomTabNavigator = createBottomTabNavigator(
Tab1,
Tab2,

initialRouteName: 'Tab1',

)


Stack Navigator:



const AppNavigator = createStackNavigator(


BottomTabNavigator,
Screen1,
Screen2,
Screen3

);


I tried the below but as expected it does navigate to the initial route which is Tab1



const resetAction = StackActions.reset(index: 0, 
actions: [NavigationActions.navigate( routeName: 'BottomTabNavigator', ),],);

this.props.navigation.dispatch(resetAction);









share|improve this question
























  • Have you tried NavigationActions.navigate( routeName: 'Tab2' )

    – zaytrix
    Mar 28 at 16:57

















2















I am trying to navigate to a specific tab from a screen, as the below code shows, I want to navigate to Tab2 from Screen1



Bottom Tabs



const BottomTabNavigator = createBottomTabNavigator(
Tab1,
Tab2,

initialRouteName: 'Tab1',

)


Stack Navigator:



const AppNavigator = createStackNavigator(


BottomTabNavigator,
Screen1,
Screen2,
Screen3

);


I tried the below but as expected it does navigate to the initial route which is Tab1



const resetAction = StackActions.reset(index: 0, 
actions: [NavigationActions.navigate( routeName: 'BottomTabNavigator', ),],);

this.props.navigation.dispatch(resetAction);









share|improve this question
























  • Have you tried NavigationActions.navigate( routeName: 'Tab2' )

    – zaytrix
    Mar 28 at 16:57













2












2








2








I am trying to navigate to a specific tab from a screen, as the below code shows, I want to navigate to Tab2 from Screen1



Bottom Tabs



const BottomTabNavigator = createBottomTabNavigator(
Tab1,
Tab2,

initialRouteName: 'Tab1',

)


Stack Navigator:



const AppNavigator = createStackNavigator(


BottomTabNavigator,
Screen1,
Screen2,
Screen3

);


I tried the below but as expected it does navigate to the initial route which is Tab1



const resetAction = StackActions.reset(index: 0, 
actions: [NavigationActions.navigate( routeName: 'BottomTabNavigator', ),],);

this.props.navigation.dispatch(resetAction);









share|improve this question














I am trying to navigate to a specific tab from a screen, as the below code shows, I want to navigate to Tab2 from Screen1



Bottom Tabs



const BottomTabNavigator = createBottomTabNavigator(
Tab1,
Tab2,

initialRouteName: 'Tab1',

)


Stack Navigator:



const AppNavigator = createStackNavigator(


BottomTabNavigator,
Screen1,
Screen2,
Screen3

);


I tried the below but as expected it does navigate to the initial route which is Tab1



const resetAction = StackActions.reset(index: 0, 
actions: [NavigationActions.navigate( routeName: 'BottomTabNavigator', ),],);

this.props.navigation.dispatch(resetAction);






react-native react-navigation






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 28 at 14:50









Ahmed ImamAhmed Imam

4113 silver badges17 bronze badges




4113 silver badges17 bronze badges















  • Have you tried NavigationActions.navigate( routeName: 'Tab2' )

    – zaytrix
    Mar 28 at 16:57

















  • Have you tried NavigationActions.navigate( routeName: 'Tab2' )

    – zaytrix
    Mar 28 at 16:57
















Have you tried NavigationActions.navigate( routeName: 'Tab2' )

– zaytrix
Mar 28 at 16:57





Have you tried NavigationActions.navigate( routeName: 'Tab2' )

– zaytrix
Mar 28 at 16:57












1 Answer
1






active

oldest

votes


















1
















You can set action on the NavigationAction.navigate's input object in order to also define the tab route.



NavigationActions.navigate(
routeName: 'BottomTabNavigator',
action: NavigationActions.navigate(
routeName: 'Tab2'
)
)


or in your case



const resetAction = StackActions.reset(
index: 0,
actions: [
NavigationActions.navigate(
routeName: 'BottomTabNavigator',
action: NavigationActions.navigate(
routeName: 'Tab2'
)
)
]
);





share|improve this answer
























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );














    draft saved

    draft discarded
















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55400577%2freact-native-bottomtabs-navigating-to-a-specific-tab%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1
















    You can set action on the NavigationAction.navigate's input object in order to also define the tab route.



    NavigationActions.navigate(
    routeName: 'BottomTabNavigator',
    action: NavigationActions.navigate(
    routeName: 'Tab2'
    )
    )


    or in your case



    const resetAction = StackActions.reset(
    index: 0,
    actions: [
    NavigationActions.navigate(
    routeName: 'BottomTabNavigator',
    action: NavigationActions.navigate(
    routeName: 'Tab2'
    )
    )
    ]
    );





    share|improve this answer





























      1
















      You can set action on the NavigationAction.navigate's input object in order to also define the tab route.



      NavigationActions.navigate(
      routeName: 'BottomTabNavigator',
      action: NavigationActions.navigate(
      routeName: 'Tab2'
      )
      )


      or in your case



      const resetAction = StackActions.reset(
      index: 0,
      actions: [
      NavigationActions.navigate(
      routeName: 'BottomTabNavigator',
      action: NavigationActions.navigate(
      routeName: 'Tab2'
      )
      )
      ]
      );





      share|improve this answer



























        1














        1










        1









        You can set action on the NavigationAction.navigate's input object in order to also define the tab route.



        NavigationActions.navigate(
        routeName: 'BottomTabNavigator',
        action: NavigationActions.navigate(
        routeName: 'Tab2'
        )
        )


        or in your case



        const resetAction = StackActions.reset(
        index: 0,
        actions: [
        NavigationActions.navigate(
        routeName: 'BottomTabNavigator',
        action: NavigationActions.navigate(
        routeName: 'Tab2'
        )
        )
        ]
        );





        share|improve this answer













        You can set action on the NavigationAction.navigate's input object in order to also define the tab route.



        NavigationActions.navigate(
        routeName: 'BottomTabNavigator',
        action: NavigationActions.navigate(
        routeName: 'Tab2'
        )
        )


        or in your case



        const resetAction = StackActions.reset(
        index: 0,
        actions: [
        NavigationActions.navigate(
        routeName: 'BottomTabNavigator',
        action: NavigationActions.navigate(
        routeName: 'Tab2'
        )
        )
        ]
        );






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 28 at 18:48









        Michael MarvickMichael Marvick

        4063 silver badges13 bronze badges




        4063 silver badges13 bronze badges





















            Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







            Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.




















            draft saved

            draft discarded















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55400577%2freact-native-bottomtabs-navigating-to-a-specific-tab%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

            SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

            은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현