react-native-router-flux - Resetting navigation stack in tab - react-native

What we want
We use react-native-router-flux in our application and find ourself in a situation where we need to reset the navigation stack (at least) for one tab. This is our scene structure:
tabs
listTab
listView
recordingView
creationTab
recordView
descriptionView
publishView
Concretely, our application lets users create and view recordings. There's a listTab, with two sub-scenes (list of recordings and view a single recording) and a tab for creating (creationTab) recordings with several steps (recordView, descriptionView, publishView). After the last step, the recording is published and we redirect to the viewRecording scene for that recording in the listTab.
When pressing the creationTab again, we would like to get back to the first scene of the creation process again, but instead we of course land on the last step (publishView) again.
What we tried
After reading through the documentation and issues connected to this, we figured the option reset might help us. However, if we try to add type='reset' to the props of creationTab, when pressing the tab, all other tab icons disappear (as documented in this issue).
So instead, we then tried to set the type of our push from publishView to recordingView to reset, but that also did not work (although the right action is dispatched and the back button is removed on the new scene, when hitting the recordingTab icon again, we still get back to our old publishView).
We also though about using Switches, to unmount the components but it doesn't seem like this is how they were intended to be used...
Versions
react-native: 0.30.0
react-native-router-flux: 3.32.0
We're now getting a bit desperate after days spent on issues like this and similar ones and I am not sure how we should proceed. Has anybody experienced similar problems or found a solution?

I faced the same issue. As a temporary workaround, I do not use the reset option but instead follow the redirection immediately with a pop action.
In my case, my view is only one level deep so this is not too dirty. I'll look for a cleaner solution but I hope it can help in the meantime.
react-native: 0.35.0-rc
react-native-router-flux: 3.35.0

Related

Init with push vue router, back button not working

The problem seems easier but not working, im working over a spa on webview for apps.
So for example, in some cases I start the web with a main route, like 'localhost/path1/path2'.
So if they press a custom button in topbar (custom component), it goes to 'localhost/path1', here perfect.
The problem is when they press the native back button, or the back arrow in desktop (native).
What happen here is the app is closed or the url is empty in desktop.
I tried to force a push in many ways on load vue with many paths, but not working, I tried to intercept native back and force push to avoid close first time with many paths, but not working anyways.
If someone understand what Im saying and a solve for urls with path/id, and after native back just keep path, instead of close I hope you can help.
Thanks

how to navigate between webview pages described in different files

Good day, I have such a problem. The application is made on the basis of webview, at the beta stage. And I faced such a problem that after the registration stage I need to launch a separate page in which the native elements and the webview are combined. Please give a tip on how to cope with this task
U.P.D The crux of the problem is this. I have a file that describes one webview page. I need to make sure that after the user is registered, he is thrown to another file, where the webview is also described, but in addition to the webview there are native menu elements for the user to navigate the application. If it's not clear, I can try to make a block diagram, maybe this will be clearer

How to programmatically close an ActionSheetIOS in React Native?

I can't find a way to programmatically close an ActionSheetIOS. When the device orientation changes, if there is an action sheet open, I need to close it before reopening it (otherwise it is erroneously anchored to the wrong location). I haven't been able to find a way to trigger closing it without requiring user input. Is this possible programmatically?
The documentation does not mention this being possible in the current version (0.38.0). I also could not find any related issue, so the only ideas that comes to mind are either finding a package that implements the functionality JS.coach, or extending the implementation of ActionSheetIOS to include that functionality. Maybe this question might be helpful.
React Native version 0.69.0 has added the ActionSheetIOS.dismissActionSheet() method, which will dismiss the most upper action sheet.

how to navigate to settings in android emulator using robotium?

I am a newbie for Robotium and till then I managed to learn a lot by directly writing test cases for public websites and sorted out several issues from answers in stackoverflow. now, I seemed to hit the wall at this (probably)trivial problem.
I would like to navigate to 'Settings' icon which is inside 'Apps' menu of the android emulator using some sort of 'robotium-solo' method.
This is my failed attempt:
solo.sendKey(KeyEvent.KEYCODE_HOME);
//solo.clickOnImageButton(2); // no success!
//solo.clickOnActionBarItem(2); // no success!
solo.clickOnText("Settings");
solo.clickOnText("Music");
I checked for any KEYCODE_var for home screen 'app' icon but couldn't find one.
There is no useful log message in DDMS to figure out the starting activity when clicked/tapped on that button.s
Please guide me whether my approach is any good and help me with an answer. Thanks.
you can check with getCurrentViews() and have the list of views displayed before clicking the menu button and after clicking the menu button.By comparing them you can get the view of the new views displayed (i.e. settings button).
After getting the view,you can go with solo.clickOnView(ViewNameObtained);
This will solve your problem for sure.
As far as I know, navigating to settings is not possible with robotium. Even if you would be able to go there you cannot perform any other action as Settings are not port of your application. Android Instrumentation allows performing actions only within one package and robotium is only wrapper for that, so it's not able to click outside your application as well.
You can use UI Automator for that.

Divshot Page Editor - No Navigator?

I'm checking out DivShot for the first time, and have fallen at the first hurdle.
On launching the app, I get the page editing screen, as expected, with the Inspector, Components and Page Options tabs on the right hand side of the screen.
But on the left hand side, there is no Navigator. And I can find no reference to the Navigator anywhere on the screen (thinking it might be a collapsed area, or something).
Looking at the Intro video on the Divshot website, there do seem to be some minor differences (the lack of the Navigator notwithstanding), so I am wondering whether something has changed in the latest release...
In any case, I can see no way of add files/resources/folder structures other than new pages, because of the absence of the Navigator.
Can anyone shed any light?
Much appreciated :)
It sounds like you're using the now legacy version of Divshot. We recently launched Divshot 1.0 with file support and a completely revamped project structure.
Legacy: http://app.divshot.com
New Divshot: http://builder.divshot.com
It's on a separate instance so beta users have time to export their pages and finish anything up in the old version before upgrading. Since we moved from generic folders and pages to actual files we're offering a manual upgrade.
If you'd like to update you can just go to https://api.divshot.com/upgrade and follow the instructions there. We're pushing a notice to the old version right away to eliminate any confusion. Sorry about that!