-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change tab programmatically #2368
Comments
What's your tabs configuration? Because If I do your solution, it recreates a new scene and stacked it up, and what I want to do is to jump to the existing tab (like when you click manually on the tab). Thanks, |
@fxhereng I don't understand how does tab switch via my solution can create a new scenes stack :) Could you show me your scenes? <Scene key="root">
<Tabs key="tabs">
<Scene key="tabs_tab1" />
<Scene key="tabs_tab2" />
</Tabs>
</Scene> So if I will use |
Thanks for answering! When doing I found out that the The Finally the solution I found was to do an Cheers, EDIT: I have the version 4.0.0-beta21, maybe the behavior could have change in between |
Interesting. In my case it works good. Could you give an example with such problem? It's probably a bug because I don't understand how scene change functionality can do something like this. o_O |
Pretty similar with yours: version: 4.0.0-beta21 <Scene key="root">
<Tabs key="tabs" showLabel={true} swipeEnabled={false} lazy={true} backBehavior={'initialRoute'}>
<Scene key="tabs_tab1" />
<Scene key="tabs_tab2" />
</Tabs>
</Scene> Doing
|
In previous version it was able to change current tab programmatically by Actions.refresh({ key: 'tab_1' }), but now it doesn't work. According to the docs I guess it doesn't work because of refresh action now refreshing only current scene. So may be someone know the solution?
UPD: Fine, I found the solution and it's was easy. If someone will have the same problem - just use default syntax to navigate between scenes (
Actions.tab_1()
for example).The text was updated successfully, but these errors were encountered: