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;
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
add a comment
|
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
Have you triedNavigationActions.navigate( routeName: 'Tab2' )
– zaytrix
Mar 28 at 16:57
add a comment
|
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
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
react-native react-navigation
asked Mar 28 at 14:50
Ahmed ImamAhmed Imam
4113 silver badges17 bronze badges
4113 silver badges17 bronze badges
Have you triedNavigationActions.navigate( routeName: 'Tab2' )
– zaytrix
Mar 28 at 16:57
add a comment
|
Have you triedNavigationActions.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
add a comment
|
1 Answer
1
active
oldest
votes
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'
)
)
]
);
add a comment
|
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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'
)
)
]
);
add a comment
|
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'
)
)
]
);
add a comment
|
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'
)
)
]
);
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'
)
)
]
);
answered Mar 28 at 18:48
Michael MarvickMichael Marvick
4063 silver badges13 bronze badges
4063 silver badges13 bronze badges
add a comment
|
add a comment
|
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.
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
Have you tried
NavigationActions.navigate( routeName: 'Tab2' )
– zaytrix
Mar 28 at 16:57